(testsuite) Add a --timeout option to test/run to override the default expect timeout.
This commit is contained in:
parent
f9177e5286
commit
0f49bb1e3c
1
CHANGES
1
CHANGES
@ -75,6 +75,7 @@ bash-completion (2.x)
|
|||||||
* Cleanup scripts to run tests. Make runUnit and runCompletion use test/run.
|
* Cleanup scripts to run tests. Make runUnit and runCompletion use test/run.
|
||||||
Make it possible to run tests from any directory.
|
Make it possible to run tests from any directory.
|
||||||
* Add a --debug-xtrace option to test/run using BASH_XTRACEFD from bash-4.1.
|
* Add a --debug-xtrace option to test/run using BASH_XTRACEFD from bash-4.1.
|
||||||
|
* Add a --timeout option to test/run to override the default expect timeout.
|
||||||
|
|
||||||
[ Raphaël Droz ]
|
[ Raphaël Droz ]
|
||||||
* Add xsltproc completion (Alioth: #311843).
|
* Add xsltproc completion (Alioth: #311843).
|
||||||
|
@ -862,6 +862,12 @@ proc start_interactive_test {} {
|
|||||||
if {[info exists OPT_BASH_XTRACE]} {
|
if {[info exists OPT_BASH_XTRACE]} {
|
||||||
init_bash_xtrace
|
init_bash_xtrace
|
||||||
}
|
}
|
||||||
|
global OPT_TIMEOUT
|
||||||
|
if {[info exists OPT_TIMEOUT]} {
|
||||||
|
global timeout
|
||||||
|
verbose "Changing default expect timeout from $timeout to $OPT_TIMEOUT"
|
||||||
|
set timeout $OPT_TIMEOUT
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
4
test/run
4
test/run
@ -11,6 +11,7 @@ usage() {
|
|||||||
echo "Interesting options:"
|
echo "Interesting options:"
|
||||||
echo " --tool_exec= Test against a different bash executable."
|
echo " --tool_exec= Test against a different bash executable."
|
||||||
echo " --debug Create a dbg.log in the test directory with detailed expect match information."
|
echo " --debug Create a dbg.log in the test directory with detailed expect match information."
|
||||||
|
echo " --timeout Change expect timeout from the default of 10 seconds."
|
||||||
echo " --debug-xtrace Create an xtrace.log in the test directory with set -x output. Requires bash 4.1."
|
echo " --debug-xtrace Create an xtrace.log in the test directory with set -x output. Requires bash 4.1."
|
||||||
echo
|
echo
|
||||||
echo "Example run: ./run unit/_get_cword.exp unit/compgen.exp"
|
echo "Example run: ./run unit/_get_cword.exp unit/compgen.exp"
|
||||||
@ -39,6 +40,8 @@ while [[ $# > 0 ]]; do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
--help|--usage) usage; exit 1;;
|
--help|--usage) usage; exit 1;;
|
||||||
--debug-xtrace) args+=(OPT_BASH_XTRACE=1);;
|
--debug-xtrace) args+=(OPT_BASH_XTRACE=1);;
|
||||||
|
--timeout) shift; timeout=$1;;
|
||||||
|
--timeout=*) timeout=${1/--timeout=};;
|
||||||
--tool=*) set_tool "${1#/--tool=}";;
|
--tool=*) set_tool "${1#/--tool=}";;
|
||||||
--tool) shift; set_tool "$1";;
|
--tool) shift; set_tool "$1";;
|
||||||
*/completion/*.exp|*/unit/*.exp)
|
*/completion/*.exp|*/unit/*.exp)
|
||||||
@ -51,6 +54,7 @@ while [[ $# > 0 ]]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
[[ -n $timeout ]] && args+=("OPT_TIMEOUT=$timeout")
|
||||||
[[ -z $tool ]] && { echo "Must specify tool somehow"; exit 1; }
|
[[ -z $tool ]] && { echo "Must specify tool somehow"; exit 1; }
|
||||||
|
|
||||||
runtest --outdir log --tool $tool "${args[@]}"
|
runtest --outdir log --tool $tool "${args[@]}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user