]> git.saurik.com Git - redis.git/blobdiff - tests/test_helper.tcl
fix behavior for out-of-range negative end index on ZREMRANGEBYRANK
[redis.git] / tests / test_helper.tcl
index 69d9bbf945762b14df7a9be7d139c8be416d6a90..da6520a361dcf34837453606e356b68a0a840cd9 100644 (file)
@@ -13,6 +13,9 @@ set ::host 127.0.0.1
 set ::port 16379
 set ::traceleaks 0
 set ::valgrind 0
+set ::denytags {}
+set ::allowtags {}
+set ::external 0; # If "1" this means, we are running against external instance
 
 proc execute_tests name {
     source "tests/$name.tcl"
@@ -71,7 +74,7 @@ proc main {} {
     execute_tests "integration/aof"
 
     # run tests with VM enabled
-    set ::global_overrides [list [list vm-enabled yes]]
+    set ::global_overrides {vm-enabled yes}
     execute_tests "unit/protocol"
     execute_tests "unit/basic"
     execute_tests "unit/type/list"
@@ -91,6 +94,32 @@ proc main {} {
     cleanup
 }
 
+# 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
+    } elseif {$opt eq {--host}} {
+        set ::external 1
+        set ::host $arg
+        incr j
+    } elseif {$opt eq {--port}} {
+        set ::port $arg
+        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