From: Tony Crisci Date: Wed, 1 Apr 2015 19:10:27 +0000 (-0400) Subject: complete-run: add coverage report generation X-Git-Tag: 4.11~147^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d2d72acac4481043fcef011ab533289795e7710a;p=i3%2Fi3 complete-run: add coverage report generation When `complete-run.pl` is given `--coverage-testing`, try to generate an html coverage testing report for the run. This requires i3 to be compiled with coverage testing support. --- diff --git a/testcases/complete-run.pl b/testcases/complete-run.pl index 9710017d..8a3b89f0 100755 --- a/testcases/complete-run.pl +++ b/testcases/complete-run.pl @@ -86,6 +86,16 @@ foreach my $binary (@binaries) { die "$binary is not an executable" unless -x $binary; } +if ($options{coverage}) { + qx(command -v lcov &> /dev/null); + die "Cannot find lcov needed for coverage testing." if $?; + qx(command -v genhtml &> /dev/null); + die "Cannot find genhtml needed for coverage testing." if $?; + + # clean out the counters that may be left over from previous tests. + qx(lcov -d ../ --zerocounters &> /dev/null); +} + qx(Xephyr -help 2>&1); die "Xephyr was not found in your path. Please install Xephyr (xserver-xephyr on Debian)." if $?; @@ -227,6 +237,17 @@ if ($numtests == 1) { END { cleanup() } +if ($options{coverage}) { + print("\nGenerating test coverage report...\n"); + qx(lcov -d ../ -b ../ --capture -o latest/i3-coverage.info); + qx(genhtml -o latest/i3-coverage latest/i3-coverage.info); + if ($?) { + print("Could not generate test coverage html. Did you compile i3 with test coverage support?\n"); + } else { + print("Test coverage report generated in latest/i3-coverage\n"); + } +} + exit ($aggregator->failed > 0); # @@ -391,7 +412,8 @@ available in C. =item B<--coverage-testing> -Exits i3 cleanly (instead of kill -9) to make coverage testing work properly. +Generates a test coverage report at C. Exits i3 cleanly +during tests (instead of kill -9) to make coverage testing work properly. =item B<--parallel>