[ovs-dev] [PATCH] tests: Remove bit-rotted support for "lcov".

Ben Pfaff blp at nicira.com
Fri Jul 20 17:51:28 UTC 2012


At one point I got the "lcov" utilities to work well with OVS.  Then I
didn't try to use them again for a year or so, and when I did I found that
it didn't work at all.  I wasn't able to fix the problem easily, so it
seems better to remove the feature than to leave around broken code.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 README-gcov           |    6 ----
 m4/openvswitch.m4     |    2 +-
 tests/automake.mk     |   58 ---------------------------------------------
 tests/daemon.at       |    4 ---
 tests/lcov-wrapper.in |   63 -------------------------------------------------
 tests/ovs-vsctl.at    |    5 ----
 tests/uuid.at         |   20 ---------------
 7 files changed, 1 insertions(+), 157 deletions(-)
 delete mode 100755 tests/lcov-wrapper.in

diff --git a/README-gcov b/README-gcov
index 01c49cc..2fe9f3a 100644
--- a/README-gcov
+++ b/README-gcov
@@ -16,9 +16,3 @@ code-coverage related options:
   --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
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index dca9f5f..eca6010 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -22,7 +22,7 @@ AC_DEFUN([OVS_CHECK_COVERAGE],
      [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],
diff --git a/tests/automake.mk b/tests/automake.mk
index 3e42a3e..20f9e82 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -84,64 +84,6 @@ check-pycov: all tests/atconfig tests/atlocal $(TESTSUITE) clean-pycov
 	@echo
 	@COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report
 
-# 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
-
 # valgrind support
 
 valgrind_wrappers = \
diff --git a/tests/daemon.at b/tests/daemon.at
index f188e7c..02a69b9 100644
--- a/tests/daemon.at
+++ b/tests/daemon.at
@@ -1,7 +1,6 @@
 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])
@@ -20,7 +19,6 @@ AT_CHECK([test ! -e pid])
 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])
@@ -69,7 +67,6 @@ OVS_WAIT_WHILE([kill -0 `cat parent` || kill -0 `cat newpid` || test -e pid],
 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.
@@ -86,7 +83,6 @@ AT_CHECK([test ! -e pid])
 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])
diff --git a/tests/lcov-wrapper.in b/tests/lcov-wrapper.in
deleted file mode 100755
index 0c6a359..0000000
--- a/tests/lcov-wrapper.in
+++ /dev/null
@@ -1,63 +0,0 @@
-#! /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
diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
index b9346cc..71c46cd 100644
--- a/tests/ovs-vsctl.at
+++ b/tests/ovs-vsctl.at
@@ -896,11 +896,6 @@ AT_CLEANUP
 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.
diff --git a/tests/uuid.at b/tests/uuid.at
index 24f7180..2a82fb1 100644
--- a/tests/uuid.at
+++ b/tests/uuid.at
@@ -12,27 +12,7 @@ m4_define([CHECK_UUID],
      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=
-- 
1.7.2.5




More information about the dev mailing list