(testsuite) Supported specifying bash binary

Using option `--tool_exec' you can now specify which bash binary you
want to use:

    $ ./runUnit --tool_exec /opt/bash-4/bin/bash
    $ ./runCompletion --tool_exec /opt/bash-4/bin/bash

If not specified, current `bash' as found in the tcl path (/bin/bash)
will be used.
This commit is contained in:
Freddy Vulto 2009-09-20 12:59:08 +02:00
parent 679a87d91b
commit fc3f65e6dd
2 changed files with 10 additions and 6 deletions

View File

@ -8,14 +8,16 @@ proc completion_exit {} {
proc completion_start {} {
global TESTDIR spawn_id
global TESTDIR TOOL_EXECUTABLE spawn_id
set test "completion_start"
set TESTDIR [pwd]
# Start bash and load bash-completion
exp_spawn bash --rcfile config/bashrc
assert_bash_exec {} "bash --rcfile config/bashrc"
# If `--tool_exec' option not specified, use "bash"
if {! [info exists TOOL_EXECUTABLE]} {set TOOL_EXECUTABLE bash}
exp_spawn $TOOL_EXECUTABLE --rcfile config/bashrc
assert_bash_exec {} "$TOOL_EXECUTABLE --rcfile config/bashrc"
assert_bash_exec {BASH_COMPLETION_DIR=$(cd ..; pwd)/contrib}
assert_bash_exec {BASH_COMPLETION=$(cd ..; pwd)/bash_completion}
assert_bash_exec {source $BASH_COMPLETION}

View File

@ -8,14 +8,16 @@ proc unit_exit {} {
proc unit_start {} {
global TESTDIR spawn_id
global TESTDIR TOOL_EXECUTABLE spawn_id
set test "unit_start"
set TESTDIR [pwd]
# Start bash and load bash-completion
exp_spawn bash --rcfile config/bashrc
assert_bash_exec {} "bash --rcfile config/bashrc"
# If `--tool_exec' option not specified, use "bash"
if {! [info exists TOOL_EXECUTABLE]} {set TOOL_EXECUTABLE bash}
exp_spawn $TOOL_EXECUTABLE --rcfile config/bashrc
assert_bash_exec {} "$TOOL_EXECUTABLE --rcfile config/bashrc"
assert_bash_exec {BASH_COMPLETION_DIR=$(cd ..; pwd)/contrib}
assert_bash_exec {BASH_COMPLETION=$(cd ..; pwd)/bash_completion}
# Bash < 3.2.41 has a bug where 'history' disappears from SHELLOPTS