--enable-coverage=yes
Build with gcov code coverage support.
-
- If you enable coverage and you have the "lcov" and "genhtml"
- programs in PATH, then you may run "make check-lcov" to produce a
- directory "tests/coverage.html" in the build directory with an
- analysis of the test suite's coverage. lcov is available at
- http://ltp.sourceforge.net/coverage/lcov.php
[AC_HELP_STRING([--enable-coverage],
[Enable gcov coverage tool.])],
[case "${enableval}" in
- (lcov|yes) coverage=true ;;
+ (yes) coverage=true ;;
(no) coverage=false ;;
(*) AC_MSG_ERROR([bad value ${enableval} for --enable-coverage]) ;;
esac],
@echo
@COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report
\f
-# lcov support
-
-lcov_wrappers = \
- tests/lcov/ovs-appctl \
- tests/lcov/ovs-ofctl \
- tests/lcov/ovs-vsctl \
- tests/lcov/ovs-vswitchd \
- tests/lcov/ovsdb-client \
- tests/lcov/ovsdb-server \
- tests/lcov/ovsdb-tool \
- tests/lcov/test-aes128 \
- tests/lcov/test-bundle \
- tests/lcov/test-byte-order \
- tests/lcov/test-classifier \
- tests/lcov/test-csum \
- tests/lcov/test-file_name \
- tests/lcov/test-flows \
- tests/lcov/test-hash \
- tests/lcov/test-heap \
- tests/lcov/test-hmap \
- tests/lcov/test-json \
- tests/lcov/test-jsonrpc \
- tests/lcov/test-list \
- tests/lcov/test-lockfile \
- tests/lcov/test-multipath \
- tests/lcov/test-odp \
- tests/lcov/test-ovsdb \
- tests/lcov/test-packets \
- tests/lcov/test-random \
- tests/lcov/test-reconnect \
- tests/lcov/test-sha1 \
- tests/lcov/test-stp \
- tests/lcov/test-timeval \
- tests/lcov/test-type-props \
- tests/lcov/test-unix-socket \
- tests/lcov/test-uuid \
- tests/lcov/test-vconn
-
-$(lcov_wrappers): tests/lcov-wrapper.in
- @test -d tests/lcov || mkdir tests/lcov
- sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),' \
- -e 's,[@]wrap_program[@],$@,' \
- $(top_srcdir)/tests/lcov-wrapper.in > $@.tmp
- chmod +x $@.tmp
- mv $@.tmp $@
-CLEANFILES += $(lcov_wrappers)
-EXTRA_DIST += tests/lcov-wrapper.in
-
-LCOV = lcov -b $(abs_top_builddir) -d $(abs_top_builddir) -q
-check-lcov: all tests/atconfig tests/atlocal $(TESTSUITE) $(lcov_wrappers)
- rm -fr tests/coverage.html tests/coverage.info
- $(LCOV) -c -i -o - > tests/coverage.info
- $(SHELL) '$(TESTSUITE)' -C tests CHECK_LCOV=true DISABLE_LCOV=false AUTOTEST_PATH='tests/lcov:$(AUTOTEST_PATH)' $(TESTSUITEFLAGS); \
- rc=$$?; \
- echo "Producing coverage.html..."; \
- cd tests && genhtml -q -o coverage.html coverage.info; \
- exit $$rc
-\f
# valgrind support
valgrind_wrappers = \
AT_BANNER([daemon unit tests - C])
AT_SETUP([daemon])
-AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov wrapper make pids differ
OVSDB_INIT([db])
AT_CAPTURE_FILE([pid])
AT_CAPTURE_FILE([expected])
AT_CLEANUP
AT_SETUP([daemon --monitor])
-AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov wrapper make pids differ
OVSDB_INIT([db])
AT_CAPTURE_FILE([pid])
AT_CAPTURE_FILE([parent])
AT_CLEANUP
AT_SETUP([daemon --detach])
-AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov wrapper make pids differ
AT_CAPTURE_FILE([pid])
OVSDB_INIT([db])
# Start the daemon and make sure that the pidfile exists immediately.
AT_CLEANUP
AT_SETUP([daemon --detach --monitor])
-AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov wrapper make pids differ
m4_define([CHECK],
[AT_CHECK([$1], [$2], [$3], [$4], [kill `cat daemon monitor`])])
OVSDB_INIT([db])
+++ /dev/null
-#! /bin/sh
-
-abs_top_builddir='@abs_top_builddir@'
-wrap_program=`basename '@wrap_program@'`
-
-# Strip the first directory from $PATH that contains $wrap_program,
-# so that below we run the real $wrap_program, not ourselves.
-not_found=true
-new_path=
-first=true
-save_IFS=$IFS
-IFS=:
-for dir in $PATH; do
- IFS=$save_IFS
- if $not_found && test -x "$dir/$wrap_program"; then
- not_found=false
- else
- if $first; then
- first=false
- new_path=$dir
- else
- new_path=$new_path:$dir
- fi
- fi
-done
-IFS=$save_IFS
-if $not_found; then
- echo "$0: error: cannot find $wrap_program in \$PATH" >&2
- exit 1
-fi
-PATH=$new_path
-export PATH
-
-if test "$DISABLE_LCOV" = true; then
- exec $wrap_program "$@"
- exit 1
-fi
-
-# XXX Probably want some kind of synchronization here to deal with
-# programs running in parallel.
-LCOV="lcov -b $abs_top_builddir -d $abs_top_builddir -q"
-$LCOV -z
-
-# Run the subprocess and propagate signals to it.
-for signal in 1 2 3 5 15; do
- trap "kill -$signal \$! # Propagate signal
- trap - $signal # Reset signal to default
- wait # Wait for child to die
- kill -$signal $$ # Kill ourselves with same signal
- exit 1 # Exit in case 'kill' failed" $signal
-done
-$wrap_program 0<&0 "$@" & # 0<&0 prevents shell from closing stdin
-exec 0</dev/null # Don't hold stdin open unnecessarily
-wait $!; rc=$?
-
-# Run lcov, but only if some .gcda files were produced, since lcov
-# complains otherwise.
-for file in `find "$abs_top_builddir" -name '*.gcda'`; do
- $LCOV -c -o - >> "$abs_top_builddir/tests/coverage.info"
- break
-done
-
-exit $rc
AT_SETUP([database commands -- wait-until must wait])
AT_KEYWORDS([ovs-vsctl])
-# Disable lcov for this test. All the programs running in parallel
-# race badly on access to profiling data.
-DISABLE_LCOV=true
-export DISABLE_LCOV
-
OVS_VSCTL_SETUP
# Start ovs-vsctls in background.
exit 1
fi])
-# This test is a strict subset of the larger test down below, but it
-# completes in a realistic amount of time with the "lcov" wrapper.
-AT_SETUP([UUID generation])
-AT_KEYWORDS([UUID])
-AT_CHECK([test-uuid > uuid])
-AT_CHECK([
- uuid=`cat uuid`
- CHECK_UUID])
-AT_CLEANUP
-
-# This test is a strict subset of the larger test down below, but it
-# completes in a realistic amount of time with the "lcov" wrapper.
-AT_SETUP([UUID parsing and serialization])
-AT_KEYWORDS([UUID])
-AT_CHECK([test-uuid f47ac10b-58cc-4372-a567-0e02b2c3d479], [0],
- [f47ac10b-58cc-4372-a567-0e02b2c3d479
-])
-AT_CLEANUP
-
AT_SETUP([UUID generation, parsing, serialization])
-AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov makes this test absurdly slow
AT_KEYWORDS([UUID])
AT_CHECK([
uuids=