Skip to content

Commit

Permalink
[test suite] handle versions of lcov that don't have the --rc option
Browse files Browse the repository at this point in the history
  • Loading branch information
mrash committed Mar 23, 2015
1 parent c7be9ba commit d058493
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
8 changes: 6 additions & 2 deletions ChangeLog
Expand Up @@ -2,8 +2,12 @@ fwknop-2.6.6 (02//2015):
- [server] Bug fix when compiled with --enable-udp-server to not include
pcap.h, which is likely not installed whenever libpcap is also not
installed. This bug was reported by Alexander Kozhevnikov.
- Set AFL_HARDEN=1 to AFL fuzzing wrapper scripts. This enables simple
memory bug detection in AFL at the cost of a small performance hit.
- [test suite] Set AFL_HARDEN=1 to AFL fuzzing wrapper scripts. This
enables simple memory bug detection in AFL at the cost of a small
performance hit.
- [test suite] Handle versions of lcov that don't have the --rc argument
which is normally used to force the creation branch coverage stats when
code coverage reports are created.

fwknop-2.6.5 (12/16/2014):
- [server] (Grant Pannell) Added a new access.conf variable "DESTINATION"
Expand Down
2 changes: 2 additions & 0 deletions Makefile.am
Expand Up @@ -424,6 +424,8 @@ EXTRA_DIST = \
test/configure_max_coverage.sh \
test/rm-coverage-files.sh \
test/gen-coverage-report.sh \
test/init-lcov.sh \
test/lcov.env \
test/configure_max_coverage.sh \
test/README \
VERSION \
Expand Down
8 changes: 4 additions & 4 deletions test/gen-coverage-report.sh
Expand Up @@ -4,10 +4,10 @@

cd ..

lcov --rc lcov_branch_coverage=1 --no-checksum --capture --directory . --output-file $LCOV_INFO
lcov --rc lcov_branch_coverage=1 --no-checksum -a $LCOV_BASE -a $LCOV_INFO --output-file $LCOV_INFO_FINAL
lcov --rc lcov_branch_coverage=1 --no-checksum -r $LCOV_INFO /usr/include/\* --output-file $LCOV_INFO_FINAL
genhtml --branch-coverage --output-directory $LCOV_RESULTS_DIR --branch-coverage $LCOV_INFO_FINAL
lcov $LCOV_RC_BC --no-checksum --capture --directory . --output-file $LCOV_INFO
lcov $LCOV_RC_BC --no-checksum -a $LCOV_BASE -a $LCOV_INFO --output-file $LCOV_INFO_FINAL
lcov $LCOV_RC_BC --no-checksum -r $LCOV_INFO /usr/include/\* --output-file $LCOV_INFO_FINAL
genhtml $GENHTML_USE_BC --output-directory $LCOV_RESULTS_DIR --branch-coverage $LCOV_INFO_FINAL

cd $TOP_DIR
exit
4 changes: 2 additions & 2 deletions test/init-lcov.sh
Expand Up @@ -7,8 +7,8 @@ cd ..
[ -d $LCOV_RESULTS_DIR ] && rm -rf $LCOV_RESULTS_DIR
[ ! -d $LCOV_RESULTS_DIR ] && mkdir $LCOV_RESULTS_DIR

lcov --rc lcov_branch_coverage=1 --no-checksum --zerocounters --directory .
lcov --rc lcov_branch_coverage=1 --no-checksum --capture --initial --directory . --output-file $LCOV_BASE
lcov $LCOV_RC_BC --no-checksum --zerocounters --directory .
lcov $LCOV_RC_BC --no-checksum --capture --initial --directory . --output-file $LCOV_BASE

cd $TOP_DIR
exit
9 changes: 9 additions & 0 deletions test/lcov.env
Expand Up @@ -3,3 +3,12 @@ LCOV_BASE="$TOP_DIR/lcov_coverage.base"
LCOV_INFO="$TOP_DIR/lcov_coverage.info"
LCOV_INFO_FINAL="$TOP_DIR/lcov_coverage_final.info"
LCOV_RESULTS_DIR="$TOP_DIR/lcov-results"

### check to see if lcov offers the --rc option
LCOV_RC_BC=""
GENHTML_USE_BC=""
if `lcov -h | grep -q "\-\-rc"`;
then
LCOV_RC_BC="--rc lcov_branch_coverage=1"
GENHTML_USE_BC="--branch-coverage"
fi

0 comments on commit d058493

Please sign in to comment.