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
002052f8
Commit
002052f8
authored
Apr 17, 2020
by
antirez
Browse files
A few comments and name changes for #7103.
parent
eae26153
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_helper.tcl
View file @
002052f8
...
...
@@ -106,14 +106,23 @@ set ::tlsdir "tests/tls"
set ::client 0
set ::numclients 16
proc execute_tests name
{
# This function is called by one of the test clients when it receives
# a
"run"
command from the server, with a filename as data.
# It will run the specified test source file and signal it to the
# test server when finished.
proc execute_test_file name
{
set path
"tests/
$name.tcl
"
set ::curfile $path
source $path
send_data_packet $::test_server_fd done
"
$name
"
}
proc execute_code
{
name code
}
{
# This function is called by one of the test clients when it receives
# a
"run_code"
command from the server, with a verbatim test source code
# as argument, and an associated name.
# It will run the specified code and signal it to the test server when
# finished.
proc execute_test_code
{
name code
}
{
eval $code
send_data_packet $::test_server_fd done
"
$name
"
}
...
...
@@ -467,10 +476,10 @@ proc test_client_main server_port {
set payload
[
read $::test_server_fd $bytes
]
foreach
{
cmd data
}
$payload break
if
{
$cmd
eq
{
run
}}
{
execute_test
s
$data
execute_test
_file
$data
}
elseif
{
$cmd
eq
{
run_code
}}
{
foreach
{
name code
}
$data break
execute_code $name $code
execute_
test_
code $name $code
}
else
{
error
"Unknown test client command:
$cmd
"
}
...
...
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