]>
git.saurik.com Git - redis.git/blob - tests/support/test.tcl
5 proc test
{name code okpattern
} {
6 # abort if tagged with a tag to deny
7 foreach tag
$::denytags {
8 if {[lsearch $::tags $tag] >= 0} {
13 # check if tagged with at least 1 tag to allow when there *is* a list
14 # of tags to allow, because default policy is to run everything
15 if {[llength $::allowtags] > 0} {
17 foreach tag
$::allowtags {
18 if {[lsearch $::tags $tag] >= 0} {
28 puts -nonewline [format "#%03d %-68s " $::testnum $name]
30 if {[catch {set retval
[uplevel 1 $code]} error]} {
32 puts "\nCaught error: $error"
35 if {$okpattern eq
$retval ||
[string match
$okpattern $retval]} {
39 puts "!! ERROR expected\n'$okpattern'\nbut got\n'$retval'"
43 if {![string match
{*0 leaks
*} [exec leaks redis-server
]]} {
44 puts "--------- Test $::testnum LEAKED! --------"