Skip to content

Commit

Permalink
more advanced leaks detection in test redis
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Apr 15, 2010
1 parent fb765a0 commit bc55456
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test-redis.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ proc test {name code okpattern} {
puts "!! ERROR expected\n'$okpattern'\nbut got\n'$retval'"
incr ::failed
}
if {$::traceleaks} {
if {![string match {*0 leaks*} [exec leaks redis-server]]} {
puts "--------- Test $::testnum LEAKED! --------"
exit 1
}
}
}

proc randstring {min max {type binary}} {
Expand Down Expand Up @@ -2150,6 +2156,7 @@ proc stress {} {
set ::host 127.0.0.1
set ::port 6379
set ::stress 0
set ::traceleaks 0
set ::flush 0
set ::first 0
set ::last 1000000
Expand All @@ -2165,8 +2172,10 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
} elseif {$opt eq {-p} && !$lastarg} {
set ::port $arg
incr j
} elseif {$opt eq {-stress}} {
} elseif {$opt eq {--stress}} {
set ::stress 1
} elseif {$opt eq {--trace-leaks}} {
set ::traceleaks 1
} elseif {$opt eq {--flush}} {
set ::flush 1
} elseif {$opt eq {--first} && !$lastarg} {
Expand Down

0 comments on commit bc55456

Please sign in to comment.