Module: Yolo::Tools::Ios::Coverage
- Defined in:
- lib/yolo/tools/ios/coverage.rb
Overview
Runs test coverage calcuations using gcovr and outputs reports
Class Method Summary collapse
-
.calculate(build_path = "", output_dir = "") ⇒ type
Runs gcovr and outputs reports to a defined location.
Class Method Details
.calculate(build_path = "", output_dir = "") ⇒ type
Runs gcovr and outputs reports to a defined location
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/yolo/tools/ios/coverage.rb', line 16 def self.calculate(build_path = "", output_dir = "") error_formatter = Yolo::Formatters::ErrorFormatter.new if build_path.length == 0 or output_dir.length == 0 error_formatter.coverage_directory_error return end IO.popen("cd #{build_path} && gcovr --xml > #{output_dir}/coverage.xml") do |io| begin while line = io.readline puts line end rescue EOFError puts "Error while executing" end end $?.exitstatus if $? end |