]> git.saurik.com Git - redis.git/blobdiff - tests/support/server.tcl
no longer prints testing... but just shows the test when we get the final result...
[redis.git] / tests / support / server.tcl
index ad711e6ee224f382bcf80a3ceba4a2b279cd4c5f..fb8c43d0416502df44250dec03d7e4e654bbda93 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"
     }
 }
 
@@ -177,15 +179,12 @@ proc start_server {options {code undefined}} {
     if {$::valgrind} {
         exec valgrind --suppressions=src/valgrind.sup src/redis-server $config_file > $stdout 2> $stderr &
     } else {
-        if {$::verbose} {
-            puts "Logging on $stdout / $stderr"
-        }
         exec src/redis-server $config_file > $stdout 2> $stderr &
     }
     
     # check that the server actually started
     # ugly but tries to be as fast as possible...
-    set retrynum 20
+    set retrynum 100
     set serverisup 0
 
     if {$::verbose} {
@@ -217,7 +216,7 @@ proc start_server {options {code undefined}} {
     
     # find out the pid
     while {![info exists pid]} {
-        regexp {^\[(\d+)\]} [exec head -n1 $stdout] _ pid
+        regexp {\[(\d+)\]} [exec cat $stdout] _ pid
         after 100
     }