Skip to content

Commit d386c3d

Browse files
author
Nicholas Nethercote
committed
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
1 parent 307393d commit d386c3d

26 files changed

+136
-8
lines changed

addrcheck/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
SUBDIRS = . docs
2+
SUBDIRS = . docs tests
33

44
INCLUDES = -I$(top_srcdir)/include
55

addrcheck/tests/.cvsignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Makefile.in
2+
Makefile

addrcheck/tests/Makefile.am

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Process this file with automake to produce Makefile.in
2+
3+
noinst_SCRIPTS = filter_stderr
4+
5+
EXTRA_DIST = \
6+
$(noinst_SCRIPTS) \
7+
true.stderr.exp true.stderr.exp.hd true.vgtest

addrcheck/tests/filter_stderr

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#! /bin/sh
2+
3+
# Same as for MemCheck
4+
5+
dir=`dirname $0`
6+
7+
$dir/../../memcheck/tests/filter_stderr
8+

addrcheck/tests/true.stderr.exp

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
4+
malloc/free: in use at exit: 0 bytes in 0 blocks.
5+
malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
6+
For a detailed leak analysis, rerun with: --leak-check=yes
7+
For counts of detected errors, rerun with: -v

addrcheck/tests/true.stderr.exp.hd

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
4+
malloc/free: in use at exit: 0 bytes in 0 blocks.
5+
malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
6+
For a detailed leak analysis, rerun with: --leak-check=yes
7+
For counts of detected errors, rerun with: -v

addrcheck/tests/true.vgtest

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prog: ../../tests/true

configure.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -303,20 +303,23 @@ AC_OUTPUT(
303303
coregrind/docs/Makefile
304304
coregrind/valgrind
305305
addrcheck/Makefile
306+
addrcheck/tests/Makefile
306307
addrcheck/docs/Makefile
307308
memcheck/Makefile
308309
memcheck/tests/Makefile
309310
memcheck/docs/Makefile
310311
cachegrind/Makefile
311-
cachegrind/cg_annotate
312312
cachegrind/tests/Makefile
313313
cachegrind/docs/Makefile
314+
cachegrind/cg_annotate
314315
corecheck/Makefile
315316
corecheck/tests/Makefile
316317
corecheck/docs/Makefile
317318
helgrind/Makefile
319+
helgrind/tests/Makefile
318320
helgrind/docs/Makefile
319321
lackey/Makefile
322+
lackey/tests/Makefile
320323
lackey/docs/Makefile
321324
none/Makefile
322325
none/tests/Makefile

helgrind/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
SUBDIRS = . docs
2+
SUBDIRS = . docs tests
33

44
CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
55
-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g

helgrind/tests/.cvsignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Makefile.in
2+
Makefile

helgrind/tests/Makefile.am

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Process this file with automake to produce Makefile.in
2+
3+
noinst_SCRIPTS = filter_stderr
4+
5+
EXTRA_DIST = \
6+
$(noinst_SCRIPTS) \
7+
true.stderr.exp true.stderr.exp.hd true.vgtest

helgrind/tests/filter_stderr

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#! /bin/sh
2+
3+
# Same as for MemCheck
4+
5+
dir=`dirname $0`
6+
7+
$dir/../../tests/filter_stderr_basic |
8+
9+
# Output looks like...
10+
#
11+
# ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
12+
# [0] = { }
13+
# ==27116== 0 possible data races found
14+
15+
sed "/ERROR SUMMARY:/ , /0 possible data races found/ d"
16+

helgrind/tests/true.stderr.exp

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

helgrind/tests/true.stderr.exp.hd

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

helgrind/tests/true.vgtest

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prog: ../../tests/true

lackey/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
SUBDIRS = . docs
2+
SUBDIRS = . docs tests
33

44
CFLAGS = $(WERROR) -DVG_LIBDIR="\"$(libdir)"\" \
55
-Winline -Wall -Wshadow -O -fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -g

lackey/tests/.cvsignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Makefile.in
2+
Makefile

lackey/tests/Makefile.am

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Process this file with automake to produce Makefile.in
2+
3+
noinst_SCRIPTS = filter_stderr
4+
5+
EXTRA_DIST = \
6+
$(noinst_SCRIPTS) \
7+
true.stderr.exp true.stderr.exp.hd true.vgtest

lackey/tests/filter_stderr

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/sh
2+
3+
dir=`dirname $0`
4+
5+
$dir/../../tests/filter_stderr_basic |
6+
7+
# Output looks like this...
8+
#
9+
# Counted 53 calls to _dl_runtime_resolve()
10+
#
11+
# Executed:
12+
# BBs: 47131
13+
# x86 instrs: 193330
14+
# UInstrs: 523996
15+
#
16+
# Jccs:
17+
# total: 36368
18+
# % taken: 58%
19+
#
20+
# Ratios:
21+
# x86 instrs : BB = 41 : 10
22+
# UInstrs : BB = 111 : 10
23+
# UInstrs : x86_instr = 27 : 10
24+
#
25+
# ...so chop all lines between first and last (inclusive)
26+
sed "/^Counted [0-9]\+ calls to _dl_runtime_resolve()$/ , \
27+
/UInstrs : x86_instrs = [0-9]\+ : [0-9]\+/ \
28+
d"
29+

lackey/tests/true.stderr.exp

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

lackey/tests/true.stderr.exp.hd

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
4+
malloc/free: in use at exit: 0 bytes in 0 blocks.
5+
malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
6+
For a detailed leak analysis, rerun with: --leak-check=yes
7+
For counts of detected errors, rerun with: -v

lackey/tests/true.vgtest

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prog: ../../tests/true

memcheck/tests/filter_stderr

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#! /bin/sh
22

3-
# Skip first four lines (valgrind intro)
4-
53
dir=`dirname $0`
64

75
$dir/../../tests/filter_stderr_basic |

tests/Makefile.am

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ noinst_SCRIPTS = \
1010
filter_stderr_basic \
1111
filter_test_paths
1212

13+
noinst_PROGRAMS = \
14+
true
15+
16+
CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g
17+
CXXFLAGS = $(CFLAGS)
18+
19+
# generic C ones
20+
true_SOURCES = true.c
21+
1322
EXTRA_DIST = \
1423
$(noinst_SCRIPTS) \
1524
blocked_syscall.c \

tests/filter_stderr_basic

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
# Remove ==pid== and --pid-- and ++pid++ strings
77
sed "s/\(==\|--\|++\)[0-9]\{3,5\}\1 //" |
88

9-
# Remove "<name>, a <description> for x86-linux." line and the following
10-
# copyright notice line
9+
# Remove intro line for 1.0.X branch
10+
sed "/valgrind-.*, a memory error detector for x86 GNU\/Linux./d" |
11+
sed "/cachegrind-.*, an I1.D1.L2 cache profiler for x86 GNU\/Linux./d" |
12+
13+
# Remove "<name>, a <description> for x86-linux." line
14+
# and the following copyright notice line for post-1.0.X branch
1115
sed "/^.*, .* for x86-linux\./ , /./ d" |
1216

1317
# Remove other introductory lines

tests/true.c

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
int main(void)
2+
{
3+
return 0;
4+
}

0 commit comments

Comments
 (0)