Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
19bc8371
Unverified
Commit
19bc8371
authored
Aug 10, 2021
by
yoav-steinberg
Committed by
GitHub
Aug 10, 2021
Browse files
support regex in "--only" in runtest (#9352)
parent
8ab33c18
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/support/test.tcl
View file @
19bc8371
...
...
@@ -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
{}}}
{
# abort if test name in skiptests
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
if
{[
llength $::only_tests
]
> 0 &&
[
l
search $::only_tests
$name
]
< 0
}
{
if
{[
llength $::only_tests
]
> 0 &&
[
search
_pattern_list $name
$::only_tests
]
< 0
}
{
incr ::num_skipped
send_data_packet $::test_server_fd skip $name
return
...
...
tests/test_helper.tcl
View file @
19bc8371
...
...
@@ -562,7 +562,7 @@ proc print_help_screen {} {
"--single <unit> Just execute the specified unit (see next option). This option can be repeated."
"--verbose Increases verbosity."
"--list-tests List all the available test units."
"--only <test> Just execute t
he specified test by test name
. This option can be repeated."
"--only <test> Just execute t
ests that match <test> regexp
. This option can be repeated."
"--skip-till <unit> Skip all units until (and including) the specified one."
"--skipunit <unit> Skip one unit."
"--clients <num> Number of test clients (default 16)."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment