From: Nicholas Nethercote Date: Fri, 4 Oct 2002 11:35:47 +0000 (+0000) Subject: Added one regression test for each of addrcheck, lackey, and helgrind, each of X-Git-Tag: svn/VALGRIND_1_9_4~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d386c3db8e7221907917bd9abbefca2ce21f3d6c;p=thirdparty%2Fvalgrind.git Added one regression test for each of addrcheck, lackey, and helgrind, each of which had none previously. They all run tests/true (added as well), just to automatically catch any total b0rkage errors. Also fixed up filter_stderr_basic to account for changes to startup message; my changes from yesterday broke all the --stable tests. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1179 --- diff --git a/addrcheck/Makefile.am b/addrcheck/Makefile.am index 69bda72798..27ee63b253 100644 --- a/addrcheck/Makefile.am +++ b/addrcheck/Makefile.am @@ -1,5 +1,5 @@ -SUBDIRS = . docs +SUBDIRS = . docs tests INCLUDES = -I$(top_srcdir)/include diff --git a/addrcheck/tests/.cvsignore b/addrcheck/tests/.cvsignore new file mode 100644 index 0000000000..3dda72986f --- /dev/null +++ b/addrcheck/tests/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/addrcheck/tests/Makefile.am b/addrcheck/tests/Makefile.am new file mode 100644 index 0000000000..c66762303b --- /dev/null +++ b/addrcheck/tests/Makefile.am @@ -0,0 +1,7 @@ +## Process this file with automake to produce Makefile.in + +noinst_SCRIPTS = filter_stderr + +EXTRA_DIST = \ + $(noinst_SCRIPTS) \ + true.stderr.exp true.stderr.exp.hd true.vgtest diff --git a/addrcheck/tests/filter_stderr b/addrcheck/tests/filter_stderr new file mode 100755 index 0000000000..e7668baff1 --- /dev/null +++ b/addrcheck/tests/filter_stderr @@ -0,0 +1,8 @@ +#! /bin/sh + +# Same as for MemCheck + +dir=`dirname $0` + +$dir/../../memcheck/tests/filter_stderr + diff --git a/addrcheck/tests/true.stderr.exp b/addrcheck/tests/true.stderr.exp new file mode 100644 index 0000000000..c4aa6f04fe --- /dev/null +++ b/addrcheck/tests/true.stderr.exp @@ -0,0 +1,7 @@ + + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +malloc/free: in use at exit: 0 bytes in 0 blocks. +malloc/free: 0 allocs, 0 frees, 0 bytes allocated. +For a detailed leak analysis, rerun with: --leak-check=yes +For counts of detected errors, rerun with: -v diff --git a/addrcheck/tests/true.stderr.exp.hd b/addrcheck/tests/true.stderr.exp.hd new file mode 100644 index 0000000000..c4aa6f04fe --- /dev/null +++ b/addrcheck/tests/true.stderr.exp.hd @@ -0,0 +1,7 @@ + + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +malloc/free: in use at exit: 0 bytes in 0 blocks. +malloc/free: 0 allocs, 0 frees, 0 bytes allocated. +For a detailed leak analysis, rerun with: --leak-check=yes +For counts of detected errors, rerun with: -v diff --git a/addrcheck/tests/true.vgtest b/addrcheck/tests/true.vgtest new file mode 100644 index 0000000000..24fc0a48c5 --- /dev/null +++ b/addrcheck/tests/true.vgtest @@ -0,0 +1 @@ +prog: ../../tests/true diff --git a/configure.in b/configure.in index 5ff0954afa..29918087e2 100644 --- a/configure.in +++ b/configure.in @@ -303,20 +303,23 @@ AC_OUTPUT( coregrind/docs/Makefile coregrind/valgrind addrcheck/Makefile + addrcheck/tests/Makefile addrcheck/docs/Makefile memcheck/Makefile memcheck/tests/Makefile memcheck/docs/Makefile cachegrind/Makefile - cachegrind/cg_annotate cachegrind/tests/Makefile cachegrind/docs/Makefile + cachegrind/cg_annotate corecheck/Makefile corecheck/tests/Makefile corecheck/docs/Makefile helgrind/Makefile + helgrind/tests/Makefile helgrind/docs/Makefile lackey/Makefile + lackey/tests/Makefile lackey/docs/Makefile none/Makefile none/tests/Makefile diff --git a/helgrind/Makefile.am b/helgrind/Makefile.am index 677ef16ab5..f6e37579c0 100644 --- a/helgrind/Makefile.am +++ b/helgrind/Makefile.am @@ -1,5 +1,5 @@ -SUBDIRS = . docs +SUBDIRS = . docs tests CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \ -Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g diff --git a/helgrind/tests/.cvsignore b/helgrind/tests/.cvsignore new file mode 100644 index 0000000000..3dda72986f --- /dev/null +++ b/helgrind/tests/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am new file mode 100644 index 0000000000..c66762303b --- /dev/null +++ b/helgrind/tests/Makefile.am @@ -0,0 +1,7 @@ +## Process this file with automake to produce Makefile.in + +noinst_SCRIPTS = filter_stderr + +EXTRA_DIST = \ + $(noinst_SCRIPTS) \ + true.stderr.exp true.stderr.exp.hd true.vgtest diff --git a/helgrind/tests/filter_stderr b/helgrind/tests/filter_stderr new file mode 100755 index 0000000000..0f1c570484 --- /dev/null +++ b/helgrind/tests/filter_stderr @@ -0,0 +1,16 @@ +#! /bin/sh + +# Same as for MemCheck + +dir=`dirname $0` + +$dir/../../tests/filter_stderr_basic | + +# Output looks like... +# +# ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +# [0] = { } +# ==27116== 0 possible data races found + +sed "/ERROR SUMMARY:/ , /0 possible data races found/ d" + diff --git a/helgrind/tests/true.stderr.exp b/helgrind/tests/true.stderr.exp new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/helgrind/tests/true.stderr.exp @@ -0,0 +1,2 @@ + + diff --git a/helgrind/tests/true.stderr.exp.hd b/helgrind/tests/true.stderr.exp.hd new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/helgrind/tests/true.stderr.exp.hd @@ -0,0 +1,2 @@ + + diff --git a/helgrind/tests/true.vgtest b/helgrind/tests/true.vgtest new file mode 100644 index 0000000000..24fc0a48c5 --- /dev/null +++ b/helgrind/tests/true.vgtest @@ -0,0 +1 @@ +prog: ../../tests/true diff --git a/lackey/Makefile.am b/lackey/Makefile.am index da6e4e0c76..572bd043c4 100644 --- a/lackey/Makefile.am +++ b/lackey/Makefile.am @@ -1,5 +1,5 @@ -SUBDIRS = . docs +SUBDIRS = . docs tests CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \ -Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g diff --git a/lackey/tests/.cvsignore b/lackey/tests/.cvsignore new file mode 100644 index 0000000000..3dda72986f --- /dev/null +++ b/lackey/tests/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/lackey/tests/Makefile.am b/lackey/tests/Makefile.am new file mode 100644 index 0000000000..c66762303b --- /dev/null +++ b/lackey/tests/Makefile.am @@ -0,0 +1,7 @@ +## Process this file with automake to produce Makefile.in + +noinst_SCRIPTS = filter_stderr + +EXTRA_DIST = \ + $(noinst_SCRIPTS) \ + true.stderr.exp true.stderr.exp.hd true.vgtest diff --git a/lackey/tests/filter_stderr b/lackey/tests/filter_stderr new file mode 100755 index 0000000000..6fd7ebdbe9 --- /dev/null +++ b/lackey/tests/filter_stderr @@ -0,0 +1,29 @@ +#! /bin/sh + +dir=`dirname $0` + +$dir/../../tests/filter_stderr_basic | + +# Output looks like this... +# +# Counted 53 calls to _dl_runtime_resolve() +# +# Executed: +# BBs: 47131 +# x86 instrs: 193330 +# UInstrs: 523996 +# +# Jccs: +# total: 36368 +# % taken: 58% +# +# Ratios: +# x86 instrs : BB = 41 : 10 +# UInstrs : BB = 111 : 10 +# UInstrs : x86_instr = 27 : 10 +# +# ...so chop all lines between first and last (inclusive) +sed "/^Counted [0-9]\+ calls to _dl_runtime_resolve()$/ , \ + /UInstrs : x86_instrs = [0-9]\+ : [0-9]\+/ \ + d" + diff --git a/lackey/tests/true.stderr.exp b/lackey/tests/true.stderr.exp new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/lackey/tests/true.stderr.exp @@ -0,0 +1,2 @@ + + diff --git a/lackey/tests/true.stderr.exp.hd b/lackey/tests/true.stderr.exp.hd new file mode 100644 index 0000000000..c4aa6f04fe --- /dev/null +++ b/lackey/tests/true.stderr.exp.hd @@ -0,0 +1,7 @@ + + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +malloc/free: in use at exit: 0 bytes in 0 blocks. +malloc/free: 0 allocs, 0 frees, 0 bytes allocated. +For a detailed leak analysis, rerun with: --leak-check=yes +For counts of detected errors, rerun with: -v diff --git a/lackey/tests/true.vgtest b/lackey/tests/true.vgtest new file mode 100644 index 0000000000..24fc0a48c5 --- /dev/null +++ b/lackey/tests/true.vgtest @@ -0,0 +1 @@ +prog: ../../tests/true diff --git a/memcheck/tests/filter_stderr b/memcheck/tests/filter_stderr index e654aa3f8d..511dca07bf 100755 --- a/memcheck/tests/filter_stderr +++ b/memcheck/tests/filter_stderr @@ -1,7 +1,5 @@ #! /bin/sh -# Skip first four lines (valgrind intro) - dir=`dirname $0` $dir/../../tests/filter_stderr_basic | diff --git a/tests/Makefile.am b/tests/Makefile.am index 09d5de7e19..5a63e0ac33 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -10,6 +10,15 @@ noinst_SCRIPTS = \ filter_stderr_basic \ filter_test_paths +noinst_PROGRAMS = \ + true + +CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g +CXXFLAGS = $(CFLAGS) + +# generic C ones +true_SOURCES = true.c + EXTRA_DIST = \ $(noinst_SCRIPTS) \ blocked_syscall.c \ diff --git a/tests/filter_stderr_basic b/tests/filter_stderr_basic index 398ce6368d..72e8b59ed1 100755 --- a/tests/filter_stderr_basic +++ b/tests/filter_stderr_basic @@ -6,8 +6,12 @@ # Remove ==pid== and --pid-- and ++pid++ strings sed "s/\(==\|--\|++\)[0-9]\{3,5\}\1 //" | -# Remove ", a for x86-linux." line and the following -# copyright notice line +# Remove intro line for 1.0.X branch +sed "/valgrind-.*, a memory error detector for x86 GNU\/Linux./d" | +sed "/cachegrind-.*, an I1.D1.L2 cache profiler for x86 GNU\/Linux./d" | + +# Remove ", a for x86-linux." line +# and the following copyright notice line for post-1.0.X branch sed "/^.*, .* for x86-linux\./ , /./ d" | # Remove other introductory lines diff --git a/tests/true.c b/tests/true.c new file mode 100644 index 0000000000..e0d6d5dadb --- /dev/null +++ b/tests/true.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +}