mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
support regex in "--only" in runtest (#9352)
This commit is contained in:
parent
8ab33c18e4
commit
19bc83716c
@ -115,6 +115,17 @@ proc wait_for_condition {maxtries delay e _else_ elsescript} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc search_pattern_list {value pattern_list} {
|
||||||
|
set n 0
|
||||||
|
foreach el $pattern_list {
|
||||||
|
if {[regexp -- $el $value]} {
|
||||||
|
return $n
|
||||||
|
}
|
||||||
|
incr n
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
proc test {name code {okpattern undefined} {tags {}}} {
|
proc test {name code {okpattern undefined} {tags {}}} {
|
||||||
# abort if test name in skiptests
|
# abort if test name in skiptests
|
||||||
if {[lsearch $::skiptests $name] >= 0} {
|
if {[lsearch $::skiptests $name] >= 0} {
|
||||||
@ -124,7 +135,7 @@ proc test {name code {okpattern undefined} {tags {}}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# abort if only_tests was set but test name is not included
|
# abort if only_tests was set but test name is not included
|
||||||
if {[llength $::only_tests] > 0 && [lsearch $::only_tests $name] < 0} {
|
if {[llength $::only_tests] > 0 && [search_pattern_list $name $::only_tests] < 0} {
|
||||||
incr ::num_skipped
|
incr ::num_skipped
|
||||||
send_data_packet $::test_server_fd skip $name
|
send_data_packet $::test_server_fd skip $name
|
||||||
return
|
return
|
||||||
|
@ -562,7 +562,7 @@ proc print_help_screen {} {
|
|||||||
"--single <unit> Just execute the specified unit (see next option). This option can be repeated."
|
"--single <unit> Just execute the specified unit (see next option). This option can be repeated."
|
||||||
"--verbose Increases verbosity."
|
"--verbose Increases verbosity."
|
||||||
"--list-tests List all the available test units."
|
"--list-tests List all the available test units."
|
||||||
"--only <test> Just execute the specified test by test name. This option can be repeated."
|
"--only <test> Just execute tests that match <test> regexp. This option can be repeated."
|
||||||
"--skip-till <unit> Skip all units until (and including) the specified one."
|
"--skip-till <unit> Skip all units until (and including) the specified one."
|
||||||
"--skipunit <unit> Skip one unit."
|
"--skipunit <unit> Skip one unit."
|
||||||
"--clients <num> Number of test clients (default 16)."
|
"--clients <num> Number of test clients (default 16)."
|
||||||
|
Loading…
Reference in New Issue
Block a user