diff --git a/test/lib/completion.exp b/test/lib/completion.exp index bcb8e76f..94fa2992 100644 --- a/test/lib/completion.exp +++ b/test/lib/completion.exp @@ -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} diff --git a/test/lib/unit.exp b/test/lib/unit.exp index dd09f674..19612fdc 100644 --- a/test/lib/unit.exp +++ b/test/lib/unit.exp @@ -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