Freddy Vulto 9eb0ee2851 (test suite) Added global var `bash_versinfo_0'
This variable was introduced by unit/_get_cword.exp but is now upgraded
to a global var.
2009-10-02 16:39:11 +02:00

38 lines
1.3 KiB
Plaintext

source lib/library.exp
proc unit_exit {} {
# Exit bash
send "\rexit\r"
}; # unit_exit()
proc unit_start {} {
global bash_versinfo_0 TESTDIR TOOL_EXECUTABLE spawn_id
set test "unit_start"
set TESTDIR [pwd]
# Start bash and load bash-completion
# 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
# whenever a shopt setting is sourced or eval'ed. Disabling 'history'
# makes it not show in tests "Environment should not be modified"
# for bash < 3.2.41.
# -- FVu, Tue Sep 15 22:52:00 CEST 2009
assert_bash_exec {is_bash_version_minimal 3 2 41 || set +o history}
assert_bash_exec {source $BASH_COMPLETION}
# Fill global var `bash_versinfo_0' with bash major version number
assert_bash_exec {printf "%s" "${BASH_VERSINFO[0]}"} "" /@ bash_versinfo_0
}; # unit_start()
proc unit_version {} {
puts "bash-completion-git"
}