Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pass tags to filter and match via arguments

  • Loading branch information...
commit 19b49c31f329edc10e911a2e548b49d8667c6772 1 parent 3c5b5e1
@pietern pietern authored
Showing with 21 additions and 2 deletions.
  1. +1 −1  Makefile
  2. +1 −1  tests/support/test.tcl
  3. +19 −0 tests/test_helper.tcl
View
2  Makefile
@@ -88,7 +88,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
View
2  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
}
}
View
19 tests/test_helper.tcl
@@ -91,6 +91,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
Please sign in to comment.
Something went wrong with that request. Please try again.