]> git.saurik.com Git - redis.git/blobdiff - tests/test_helper.tcl
WATCH will now consider touched keys target of EXPIRE command after the WATCH is...
[redis.git] / tests / test_helper.tcl
index 8413a8b28c1e0c9199083217bc4adb0ae1db459c..59470e6473b8780c918b1791f3fbbfd03e6010c7 100644 (file)
@@ -15,6 +15,7 @@ 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"
@@ -41,6 +42,22 @@ proc r {args} {
     [srv $level "client"] {*}$args
 }
 
+proc redis_deferring_client {args} {
+    set level 0
+    if {[llength $args] > 0 && [string is integer [lindex $args 0]]} {
+        set level [lindex $args 0]
+        set args [lrange $args 1 end]
+    }
+
+    # create client that defers reading reply
+    set client [redis [srv $level "host"] [srv $level "port"] 1]
+
+    # select the right db and read the response (OK)
+    $client select 9
+    $client read
+    return $client
+}
+
 # Provide easy access to INFO properties. Same semantic as "proc r".
 proc s {args} {
     set level 0
@@ -58,7 +75,6 @@ proc cleanup {} {
 
 proc main {} {
     cleanup
-    if 0 {
     execute_tests "unit/auth"
     execute_tests "unit/protocol"
     execute_tests "unit/basic"
@@ -67,15 +83,15 @@ proc main {} {
     execute_tests "unit/type/zset"
     execute_tests "unit/type/hash"
     execute_tests "unit/sort"
-    }
     execute_tests "unit/expire"
     execute_tests "unit/other"
     execute_tests "unit/cas"
     execute_tests "integration/replication"
     execute_tests "integration/aof"
+    execute_tests "unit/pubsub"
 
     # 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"
@@ -108,6 +124,13 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
             }
         }
         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