diff --git a/tests/libtest.sh b/tests/libtest.sh index eda3b921..2e9a99df 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -46,6 +46,14 @@ run_exit_cmds() { } trap run_exit_cmds EXIT +report_err () { + local exit_status="$?" + { { local BASH_XTRACEFD=3; } 2> /dev/null + echo "Unexpected nonzero exit status $exit_status while running: $BASH_COMMAND" >&2 + } 3> /dev/null +} +trap report_err ERR + save_core() { if [ -e core ]; then cp core "$test_srcdir/core"