Merge branch 'jk/test-with-x' into maint
Running tests with the "-x" option to make them verbose had some unpleasant interactions with other features of the test suite. * jk/test-with-x: test-lib: disable trace when test is not verbose test-lib: turn off "-x" tracing during chain-lint check
This commit is contained in:
@ -531,6 +531,10 @@ maybe_setup_valgrind () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
want_trace () {
|
||||||
|
test "$trace" = t && test "$verbose" = t
|
||||||
|
}
|
||||||
|
|
||||||
# This is a separate function because some tests use
|
# This is a separate function because some tests use
|
||||||
# "return" to end a test_expect_success block early
|
# "return" to end a test_expect_success block early
|
||||||
# (and we want to make sure we run any cleanup like
|
# (and we want to make sure we run any cleanup like
|
||||||
@ -538,7 +542,7 @@ maybe_setup_valgrind () {
|
|||||||
test_eval_inner_ () {
|
test_eval_inner_ () {
|
||||||
# Do not add anything extra (including LF) after '$*'
|
# Do not add anything extra (including LF) after '$*'
|
||||||
eval "
|
eval "
|
||||||
test \"$trace\" = t && set -x
|
want_trace && set -x
|
||||||
$*"
|
$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,7 +558,7 @@ test_eval_ () {
|
|||||||
{
|
{
|
||||||
test_eval_inner_ "$@" </dev/null >&3 2>&4
|
test_eval_inner_ "$@" </dev/null >&3 2>&4
|
||||||
test_eval_ret_=$?
|
test_eval_ret_=$?
|
||||||
if test "$trace" = t
|
if want_trace
|
||||||
then
|
then
|
||||||
set +x
|
set +x
|
||||||
if test "$test_eval_ret_" != 0
|
if test "$test_eval_ret_" != 0
|
||||||
@ -571,12 +575,17 @@ test_run_ () {
|
|||||||
expecting_failure=$2
|
expecting_failure=$2
|
||||||
|
|
||||||
if test "${GIT_TEST_CHAIN_LINT:-1}" != 0; then
|
if test "${GIT_TEST_CHAIN_LINT:-1}" != 0; then
|
||||||
|
# turn off tracing for this test-eval, as it simply creates
|
||||||
|
# confusing noise in the "-x" output
|
||||||
|
trace_tmp=$trace
|
||||||
|
trace=
|
||||||
# 117 is magic because it is unlikely to match the exit
|
# 117 is magic because it is unlikely to match the exit
|
||||||
# code of other programs
|
# code of other programs
|
||||||
test_eval_ "(exit 117) && $1"
|
test_eval_ "(exit 117) && $1"
|
||||||
if test "$?" != 117; then
|
if test "$?" != 117; then
|
||||||
error "bug in the test script: broken &&-chain: $1"
|
error "bug in the test script: broken &&-chain: $1"
|
||||||
fi
|
fi
|
||||||
|
trace=$trace_tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_malloc_check
|
setup_malloc_check
|
||||||
|
Reference in New Issue
Block a user