summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-06-02 23:04:22 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-06-02 23:22:20 +0200
commit73bd6c583b9a3e29dbbbf4f1ba8259cfe5e131b8 (patch)
tree68c107263a819290b44aa7516ff1acb3a0b1c41d
parent6e0e5bedd9c3a4bf0f53f43c427c88e2866bda0a (diff)
downloadredis-73bd6c583b9a3e29dbbbf4f1ba8259cfe5e131b8.tar.gz
pass tags to filter and match via arguments
-rw-r--r--Makefile2
-rw-r--r--tests/support/test.tcl2
-rw-r--r--tests/test_helper.tcl19
3 files changed, 21 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b7dfb1cdb..31a763ad8 100644
--- a/Makefile
+++ b/Makefile
@@ -86,7 +86,7 @@ staticsymbols:
tclsh utils/build-static-symbols.tcl > staticsymbols.h
test:
- tclsh8.5 tests/test_helper.tcl
+ tclsh8.5 tests/test_helper.tcl --tags "${TAGS}"
bench:
./redis-benchmark
diff --git a/tests/support/test.tcl b/tests/support/test.tcl
index c13072f04..d2674da19 100644
--- a/tests/support/test.tcl
+++ b/tests/support/test.tcl
@@ -15,7 +15,7 @@ proc test {name code okpattern} {
if {[llength $::allowtags] > 0} {
set matched 0
foreach tag $::allowtags {
- if {[lsearch $::tags $tag]} {
+ if {[lsearch $::tags $tag] >= 0} {
incr matched
}
}
diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl
index da9071e88..95508cda9 100644
--- a/tests/test_helper.tcl
+++ b/tests/test_helper.tcl
@@ -93,6 +93,25 @@ 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
+ } 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