Merge pull request #906 from jbergstroem/tclsh-agnostic
Make redis test suite tcl version agnostic, v2
This commit is contained in:
commit
e573f609dc
15
runtest
15
runtest
@ -1,9 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
TCL=tclsh8.5
|
TCL_VERSIONS="8.5 8.6"
|
||||||
which $TCL
|
TCLSH=""
|
||||||
if [ "$?" != "0" ]
|
|
||||||
|
for VERSION in $TCL_VERSIONS; do
|
||||||
|
TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z $TCLSH ]
|
||||||
then
|
then
|
||||||
echo "You need '$TCL' in order to run the Redis test"
|
echo "You need tcl 8.5 or newer in order to run the Redis test"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
$TCL tests/test_helper.tcl $*
|
$TCLSH tests/test_helper.tcl $*
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
proc start_bg_complex_data {host port db ops} {
|
proc start_bg_complex_data {host port db ops} {
|
||||||
exec tclsh8.5 tests/helpers/bg_complex_data.tcl $host $port $db $ops &
|
set tclsh [info nameofexecutable]
|
||||||
|
exec $tclsh tests/helpers/bg_complex_data.tcl $host $port $db $ops &
|
||||||
}
|
}
|
||||||
|
|
||||||
proc stop_bg_complex_data {handle} {
|
proc stop_bg_complex_data {handle} {
|
||||||
|
@ -78,7 +78,8 @@ start_server {tags {"repl"}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proc start_write_load {host port seconds} {
|
proc start_write_load {host port seconds} {
|
||||||
exec tclsh8.5 tests/helpers/gen_write_load.tcl $host $port $seconds &
|
set tclsh [info nameofexecutable]
|
||||||
|
exec $tclsh tests/helpers/gen_write_load.tcl $host $port $seconds &
|
||||||
}
|
}
|
||||||
|
|
||||||
proc stop_write_load {handle} {
|
proc stop_write_load {handle} {
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
# This softare is released under the BSD License. See the COPYING file for
|
# This softare is released under the BSD License. See the COPYING file for
|
||||||
# more information.
|
# more information.
|
||||||
|
|
||||||
|
package require Tcl 8.5
|
||||||
|
|
||||||
set tcl_precision 17
|
set tcl_precision 17
|
||||||
source tests/support/redis.tcl
|
source tests/support/redis.tcl
|
||||||
source tests/support/server.tcl
|
source tests/support/server.tcl
|
||||||
@ -176,6 +178,7 @@ proc find_available_port start {
|
|||||||
|
|
||||||
proc test_server_main {} {
|
proc test_server_main {} {
|
||||||
cleanup
|
cleanup
|
||||||
|
set tclsh [info nameofexecutable]
|
||||||
# Open a listening socket, trying different ports in order to find a
|
# Open a listening socket, trying different ports in order to find a
|
||||||
# non busy one.
|
# non busy one.
|
||||||
set port [find_available_port 11111]
|
set port [find_available_port 11111]
|
||||||
@ -189,7 +192,7 @@ proc test_server_main {} {
|
|||||||
set start_port [expr {$::port+100}]
|
set start_port [expr {$::port+100}]
|
||||||
for {set j 0} {$j < $::numclients} {incr j} {
|
for {set j 0} {$j < $::numclients} {incr j} {
|
||||||
set start_port [find_available_port $start_port]
|
set start_port [find_available_port $start_port]
|
||||||
set p [exec tclsh8.5 [info script] {*}$::argv \
|
set p [exec $tclsh [info script] {*}$::argv \
|
||||||
--client $port --port $start_port &]
|
--client $port --port $start_port &]
|
||||||
lappend ::clients_pids $p
|
lappend ::clients_pids $p
|
||||||
incr start_port 10
|
incr start_port 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user