tests: Add support for helgrind thread error detector.
authorWilliam Tu <u9012063@gmail.com>
Sat, 30 Apr 2016 05:13:46 +0000 (22:13 -0700)
committerBen Pfaff <blp@ovn.org>
Wed, 18 May 2016 00:03:17 +0000 (17:03 -0700)
Helgrind is a Valgrind tool for detecting thread errors, reporting three
classes of errors: misuses of the POSIX pthreads API, potential deadlocks
arising from lock ordering problems, and data races -- accessing memory
without adequate locking.  Similar to valgrind, users do "make check-helgrind"
and results will be saved at tests/testsuite.dir/<N>/helgrind.*.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
tests/automake.mk

index 1b147f6..7af7f69 100644 (file)
@@ -208,6 +208,9 @@ EXTRA_DIST += tests/valgrind-wrapper.in
 VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
        --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
        --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
+HELGRIND = valgrind --log-file=helgrind.%p --tool=helgrind \
+       --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
+       --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
 EXTRA_DIST += tests/glibc.supp tests/openssl.supp
 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) \
                 $(valgrind_wrappers) $(check_DATA)
@@ -216,6 +219,10 @@ check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) \
        @echo '----------------------------------------------------------------------'
        @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
        @echo '----------------------------------------------------------------------'
+check-helgrind: all tests/atconfig tests/atlocal $(TESTSUITE) \
+                $(valgrind_wrappers) $(check_DATA)
+       -$(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(HELGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
+
 \f
 # OFTest support.