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 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/addrcheck/Makefile.am b/addrcheck/Makefile.am
index 69bda72..27ee63b 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 0000000..3dda729
--- /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 0000000..c667623
--- /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 0000000..e7668ba
--- /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 0000000..c4aa6f0
--- /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 0000000..c4aa6f0
--- /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 0000000..24fc0a4
--- /dev/null
+++ b/addrcheck/tests/true.vgtest
@@ -0,0 +1 @@
+prog: ../../tests/true
diff --git a/configure.in b/configure.in
index 5ff0954..2991808 100644
--- a/configure.in
+++ b/configure.in
@@ -303,20 +303,23 @@
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 677ef16..f6e3757 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 0000000..3dda729
--- /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 0000000..c667623
--- /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 0000000..0f1c570
--- /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 0000000..139597f
--- /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 0000000..139597f
--- /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 0000000..24fc0a4
--- /dev/null
+++ b/helgrind/tests/true.vgtest
@@ -0,0 +1 @@
+prog: ../../tests/true
diff --git a/lackey/Makefile.am b/lackey/Makefile.am
index da6e4e0..572bd04 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 0000000..3dda729
--- /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 0000000..c667623
--- /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 0000000..6fd7ebd
--- /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 0000000..139597f
--- /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 0000000..c4aa6f0
--- /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 0000000..24fc0a4
--- /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 e654aa3..511dca0 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 09d5de7..5a63e0a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -10,6 +10,15 @@
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 398ce63..72e8b59 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 "<name>, a <description> 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 "<name>, a <description> 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 0000000..e0d6d5d
--- /dev/null
+++ b/tests/true.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}