From fc3f65e6ddf3c3f34a1351c7e7163f183e645116 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sun, 20 Sep 2009 12:59:08 +0200 Subject: [PATCH] (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. --- test/lib/completion.exp | 8 +++++--- test/lib/unit.exp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) 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