[test suite] rm previous coverage files in coverage mode when --include criteria is not used

This commit is contained in:
Michael Rash
2015-08-23 20:32:59 -07:00
parent 9531099a1f
commit b060495bb4
4 changed files with 24 additions and 0 deletions
+1
View File
@@ -455,6 +455,7 @@ EXTRA_DIST = \
test/configure_max_coverage.sh \
test/gen-coverage-report.sh \
test/init-lcov.sh \
test/rm-coverage-files.sh \
test/lcov.env \
test/configure_max_coverage.sh \
test/README \
+3
View File
@@ -4,6 +4,9 @@
cd ..
[ ! -d $TOP_DIR ] && mkdir $TOP_DIR
[ -f $LCOV_BASE ] && rm -f $LCOV_BASE
[ -f $LCOV_INFO ] && rm -f $LCOV_INFO
[ -f $LCOV_INFO_FINAL ] && rm -f $LCOV_INFO_FINAL
[ -d $LCOV_RESULTS_DIR ] && rm -rf $LCOV_RESULTS_DIR
[ ! -d $LCOV_RESULTS_DIR ] && mkdir $LCOV_RESULTS_DIR
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh -x
cd ..
for d in client server lib
do
for s in *.gcda *.gcno *.gcov
do
find $d -name $s | xargs rm -f
done
done
cd test
exit
+8
View File
@@ -247,6 +247,8 @@ my $enable_profile_coverage_check = 0;
my $enable_profile_coverage_init = 0;
my $profile_gen_report_sh = './gen-coverage-report.sh';
my $profile_init_sh = './init-lcov.sh';
my $profile_rm_files_sh = './rm-coverage-files.sh';
my $do_rm_coverage_files = 0;
my $enable_make_distcheck = 0;
my $enable_perl_module_checks = 0;
my $enable_perl_module_fuzzing_spa_pkt_generation = 0;
@@ -6888,6 +6890,8 @@ sub init() {
unlink $init_file if -e $init_file;
unlink $logfile if -e $logfile;
$do_rm_coverage_files = 1 unless @tests_to_include;
### always restore the gpg directories before tests are
### executed
&restore_gpg_dirs();
@@ -7115,6 +7119,10 @@ sub init() {
print "[-] Warning: --enable-profile-coverage not ",
"found, use ./configure --enable-profile-coverage?\n";
}
if ($do_rm_coverage_files) {
&run_cmd($profile_rm_files_sh, $cmd_out_tmp,
$curr_test_file);
}
&run_cmd($profile_init_sh, $cmd_out_tmp, $curr_test_file);
}
push @tests_to_exclude, qr/distcheck/;