]> git.saurik.com Git - redis.git/commitdiff
more valgrind friendly test
authorantirez <antirez@gmail.com>
Wed, 6 Jul 2011 13:22:00 +0000 (15:22 +0200)
committerantirez <antirez@gmail.com>
Wed, 6 Jul 2011 13:22:00 +0000 (15:22 +0200)
src/valgrind.sup
tests/support/server.tcl
tests/test_helper.tcl

index 7ba757548332f0ee5666d5c60e9ef821e1e73337..3024d63bcdde2ba9c2ac4a2a08e7b8a78cf03249 100644 (file)
@@ -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
+}
index c92754611536f16f78ad2a885a94540d279fe6e1..5c5af37d94c8747b62331ace8f4c5dc035b6591e 100644 (file)
@@ -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"
     }
 }
 
index cf55eba0812f4ae28fd14d58f7c2cb17ac23bc60..f034299f2ef591755b521ea6d751fe60f78527e1 100644 (file)
@@ -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