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:
Binbin 2024-07-13 23:25:51 +08:00 committed by GitHub
parent a4ee8dada4
commit 8c92b2f747
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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