summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-07-06 15:22:00 +0200
committerantirez <antirez@gmail.com>2011-07-06 15:22:00 +0200
commitcabe03eb758a898e5c0e6906890fd7ede0cc2be1 (patch)
tree569c410b97b3777cd0483dd38f0e9d9ef6f44fca
parent10ba492fa3674117a9af0c3c80bed90fc415847d (diff)
downloadredis-cabe03eb758a898e5c0e6906890fd7ede0cc2be1.tar.gz
more valgrind friendly test
-rw-r--r--src/valgrind.sup12
-rw-r--r--tests/support/server.tcl8
-rw-r--r--tests/test_helper.tcl9
3 files changed, 25 insertions, 4 deletions
diff --git a/src/valgrind.sup b/src/valgrind.sup
index 7ba757548..3024d63bc 100644
--- a/src/valgrind.sup
+++ b/src/valgrind.sup
@@ -3,3 +3,15 @@
Memcheck:Cond
fun:lzf_compress
}
+
+{
+ <lzf_unitialized_hash_table>
+ Memcheck:Value4
+ fun:lzf_compress
+}
+
+{
+ <lzf_unitialized_hash_table>
+ Memcheck:Value8
+ fun:lzf_compress
+}
diff --git a/tests/support/server.tcl b/tests/support/server.tcl
index c92754611..5c5af37d9 100644
--- a/tests/support/server.tcl
+++ b/tests/support/server.tcl
@@ -1,5 +1,6 @@
set ::global_overrides {}
set ::tags {}
+set ::valgrind_errors {}
proc error_and_quit {config_file error} {
puts "!!COULD NOT START REDIS-SERVER\n"
@@ -16,11 +17,12 @@ proc check_valgrind_errors stderr {
close $fd
if {![regexp -- {ERROR SUMMARY: 0 errors} $buf] ||
- ![regexp -- {definitely lost: 0 bytes} $buf]} {
+ (![regexp -- {definitely lost: 0 bytes} $buf] &&
+ ![regexp -- {no leaks are possible} $buf])} {
puts "*** VALGRIND ERRORS ***"
puts $buf
- puts "--- press enter to continue ---"
- gets stdin
+ puts "-----------------------"
+ append ::valgrind_errors "$buf\n\n"
}
}
diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl
index cf55eba08..f034299f2 100644
--- a/tests/test_helper.tcl
+++ b/tests/test_helper.tcl
@@ -138,6 +138,7 @@ proc execute_everything {} {
proc main {} {
cleanup
+ set exit_with_error 0
if {[string length $::file] > 0} {
foreach {file} [split $::file ,] {
@@ -169,8 +170,14 @@ proc main {} {
}
puts ""
- exit 1
+ incr exit_with_error
+ }
+
+ if {[string length $::valgrind_errors]} {
+ puts "Valgrind errors:\n$::valgrind_errors"
+ incr exit_with_error
}
+ if {$exit_with_error} {exit 1}
}
# parse arguments