set ::global_overrides {}
set ::tags {}
+set ::valgrind_errors {}
proc error_and_quit {config_file error} {
puts "!!COULD NOT START REDIS-SERVER\n"
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"
}
}
proc main {} {
cleanup
+ set exit_with_error 0
if {[string length $::file] > 0} {
foreach {file} [split $::file ,] {
}
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