pass tags to filter and match via arguments
This commit is contained in:
parent
6e0e5bedd9
commit
73bd6c583b
2
Makefile
2
Makefile
@ -86,7 +86,7 @@ staticsymbols:
|
|||||||
tclsh utils/build-static-symbols.tcl > staticsymbols.h
|
tclsh utils/build-static-symbols.tcl > staticsymbols.h
|
||||||
|
|
||||||
test:
|
test:
|
||||||
tclsh8.5 tests/test_helper.tcl
|
tclsh8.5 tests/test_helper.tcl --tags "${TAGS}"
|
||||||
|
|
||||||
bench:
|
bench:
|
||||||
./redis-benchmark
|
./redis-benchmark
|
||||||
|
@ -15,7 +15,7 @@ proc test {name code okpattern} {
|
|||||||
if {[llength $::allowtags] > 0} {
|
if {[llength $::allowtags] > 0} {
|
||||||
set matched 0
|
set matched 0
|
||||||
foreach tag $::allowtags {
|
foreach tag $::allowtags {
|
||||||
if {[lsearch $::tags $tag]} {
|
if {[lsearch $::tags $tag] >= 0} {
|
||||||
incr matched
|
incr matched
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,25 @@ proc main {} {
|
|||||||
cleanup
|
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 {[catch { main } err]} {
|
||||||
if {[string length $err] > 0} {
|
if {[string length $err] > 0} {
|
||||||
# only display error when not generated by the test suite
|
# only display error when not generated by the test suite
|
||||||
|
Loading…
x
Reference in New Issue
Block a user