Skip to content

Commit cabe03e

Browse files
committedJul 6, 2011
more valgrind friendly test
1 parent 10ba492 commit cabe03e

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed
 

‎src/valgrind.sup

+12
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,15 @@
33
Memcheck:Cond
44
fun:lzf_compress
55
}
6+
7+
{
8+
<lzf_unitialized_hash_table>
9+
Memcheck:Value4
10+
fun:lzf_compress
11+
}
12+
13+
{
14+
<lzf_unitialized_hash_table>
15+
Memcheck:Value8
16+
fun:lzf_compress
17+
}

‎tests/support/server.tcl

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set ::global_overrides {}
22
set ::tags {}
3+
set ::valgrind_errors {}
34

45
proc error_and_quit {config_file error} {
56
puts "!!COULD NOT START REDIS-SERVER\n"
@@ -16,11 +17,12 @@ proc check_valgrind_errors stderr {
1617
close $fd
1718

1819
if {![regexp -- {ERROR SUMMARY: 0 errors} $buf] ||
19-
![regexp -- {definitely lost: 0 bytes} $buf]} {
20+
(![regexp -- {definitely lost: 0 bytes} $buf] &&
21+
![regexp -- {no leaks are possible} $buf])} {
2022
puts "*** VALGRIND ERRORS ***"
2123
puts $buf
22-
puts "--- press enter to continue ---"
23-
gets stdin
24+
puts "-----------------------"
25+
append ::valgrind_errors "$buf\n\n"
2426
}
2527
}
2628

‎tests/test_helper.tcl

+8-1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ proc execute_everything {} {
138138

139139
proc main {} {
140140
cleanup
141+
set exit_with_error 0
141142

142143
if {[string length $::file] > 0} {
143144
foreach {file} [split $::file ,] {
@@ -169,8 +170,14 @@ proc main {} {
169170
}
170171

171172
puts ""
172-
exit 1
173+
incr exit_with_error
174+
}
175+
176+
if {[string length $::valgrind_errors]} {
177+
puts "Valgrind errors:\n$::valgrind_errors"
178+
incr exit_with_error
173179
}
180+
if {$exit_with_error} {exit 1}
174181
}
175182

176183
# parse arguments

0 commit comments

Comments
 (0)
Please sign in to comment.