Minor fix for --loops option in normal testing framework (#781)
Inputing a negative number equivalent to --loop, and inputing a number greater than or equal to 0 will cause the tests to be run one more time. Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
parent
a4ee8dada4
commit
8c92b2f747
@ -475,7 +475,7 @@ proc signal_idle_client fd {
|
||||
send_data_packet $fd run [lindex $::all_tests $::next_test]
|
||||
lappend ::active_clients $fd
|
||||
incr ::next_test
|
||||
if {$::loop && $::next_test == [llength $::all_tests]} {
|
||||
if {$::loop > 1 && $::next_test == [llength $::all_tests]} {
|
||||
set ::next_test 0
|
||||
incr ::loop -1
|
||||
}
|
||||
@ -703,6 +703,10 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
|
||||
set ::loop 2147483647
|
||||
} elseif {$opt eq {--loops}} {
|
||||
set ::loop $arg
|
||||
if {$::loop <= 0} {
|
||||
puts "Wrong argument: $opt, loops should be greater than 0"
|
||||
exit 1
|
||||
}
|
||||
incr j
|
||||
} elseif {$opt eq {--timeout}} {
|
||||
set ::timeout $arg
|
||||
|
Loading…
x
Reference in New Issue
Block a user