Module: Lcov

Includes:
Runners
Included in:
PotentialBuild
Defined in:
lib/lcov.rb

Overview

contains functions necessary for working with the 'lcov' coverage generation tool

Instance Method Summary collapse

Methods included from Runners

#monitor_thread_state, #read_state_singular, #run_scripts, #run_single_script, #run_with_timeout

Instance Method Details

#generate_base_command_line(compiler, build_dir) ⇒ Object



9
10
11
12
# File 'lib/lcov.rb', line 9

def generate_base_command_line(compiler, build_dir)
  lcov_flags = "-c -d . -o ./lcov.output --no-external --base-directory ../#{compiler[:coverage_base_dir]}"
  "cd #{build_dir} && lcov #{lcov_flags}"
end

#generate_filter_command_line(build_dir) ⇒ Object



14
15
16
# File 'lib/lcov.rb', line 14

def generate_filter_command_line(build_dir)
  "cd #{build_dir} && lcov -r ./lcov.output `pwd`/\\* -o ./lcov.output.filtered"
end

#generate_html_command_line(compiler, build_dir) ⇒ Object



18
19
20
21
22
23
# File 'lib/lcov.rb', line 18

def generate_html_command_line(compiler, build_dir)
  pass_limit = compiler[:coverage_pass_limit]
  warn_limit = compiler[:coverage_warn_limit]
  gen_html_flags = "./lcov.output.filtered -o lcov-html --demangle-cpp --function-coverage --rc genhtml_hi_limit=#{pass_limit}  --rc genhtml_med_limit=#{warn_limit}"
  "cd #{build_dir} && genhtml #{gen_html_flags}"
end

#lcov(this_config, compiler, build_dir) ⇒ Object



25
26
27
28
29
30
# File 'lib/lcov.rb', line 25

def lcov(this_config, compiler, build_dir)
  run_scripts(this_config, [generate_base_command_line(compiler, build_dir)])
  run_scripts(this_config, [generate_filter_command_line(build_dir)])
  out, = run_scripts(this_config, [generate_html_command_line(compiler, build_dir)])
  process_lcov_results(out)
end