mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
tests: prevent name clash in variables leading to wrong test name (#8995)
running the "geo" unit would have shown that it completed a unit named "north". this was because the variable `$name` was overwritten. This commit isn't perfect, but it slightly reduces the chance for variable name clash. ``` $ ./runtest --single unit/geo ....... Testing unit/geo ....... [1/1 done]: north (15 seconds) ```
This commit is contained in:
parent
91f3689bf5
commit
3e39ea0b83
@ -127,11 +127,11 @@ set ::numclients 16
|
|||||||
# a "run" command from the server, with a filename as data.
|
# a "run" command from the server, with a filename as data.
|
||||||
# It will run the specified test source file and signal it to the
|
# It will run the specified test source file and signal it to the
|
||||||
# test server when finished.
|
# test server when finished.
|
||||||
proc execute_test_file name {
|
proc execute_test_file __testname {
|
||||||
set path "tests/$name.tcl"
|
set path "tests/$__testname.tcl"
|
||||||
set ::curfile $path
|
set ::curfile $path
|
||||||
source $path
|
source $path
|
||||||
send_data_packet $::test_server_fd done "$name"
|
send_data_packet $::test_server_fd done "$__testname"
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function is called by one of the test clients when it receives
|
# This function is called by one of the test clients when it receives
|
||||||
@ -139,10 +139,10 @@ proc execute_test_file name {
|
|||||||
# as argument, and an associated name.
|
# as argument, and an associated name.
|
||||||
# It will run the specified code and signal it to the test server when
|
# It will run the specified code and signal it to the test server when
|
||||||
# finished.
|
# finished.
|
||||||
proc execute_test_code {name filename code} {
|
proc execute_test_code {__testname filename code} {
|
||||||
set ::curfile $filename
|
set ::curfile $filename
|
||||||
eval $code
|
eval $code
|
||||||
send_data_packet $::test_server_fd done "$name"
|
send_data_packet $::test_server_fd done "$__testname"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Setup a list to hold a stack of server configs. When calls to start_server
|
# Setup a list to hold a stack of server configs. When calls to start_server
|
||||||
|
Loading…
Reference in New Issue
Block a user