]> git.saurik.com Git - redis.git/blobdiff - tests/test_helper.tcl
test restored
[redis.git] / tests / test_helper.tcl
index 035f013b5d299fd6a75341fb93ccb6122c64712c..95508cda9385c3f42b9c898f36b308403af8c1df 100644 (file)
@@ -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
+    }
+}