X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/c20c189db50f331786846c821c863b44aea5e006..22194a7ffe6ada09b326ba9db1fadc549b065a4d:/tests/test_helper.tcl diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index 035f013b..95508cda 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -13,9 +13,10 @@ set ::host 127.0.0.1 set ::port 16379 set ::traceleaks 0 set ::valgrind 0 +set ::denytags {} +set ::allowtags {} proc execute_tests name { - set cur $::testnum source "tests/$name.tcl" } @@ -92,4 +93,31 @@ proc main {} { cleanup } -main +# parse arguments +for {set j 0} {$j < [llength $argv]} {incr j} { + set opt [lindex $argv $j] + set arg [lindex $argv [expr $j+1]] + if {$opt eq {--tags}} { + foreach tag $arg { + if {[string index $tag 0] eq "-"} { + lappend ::denytags [string range $tag 1 end] + } else { + lappend ::allowtags $tag + } + } + incr j + } else { + puts "Wrong argument: $opt" + exit 1 + } +} + +if {[catch { main } err]} { + if {[string length $err] > 0} { + # only display error when not generated by the test suite + if {$err ne "exception"} { + puts $err + } + exit 1 + } +}