_extra_header=$(_extra_header)
echo "Running eventscript \"$script $event${1:+ }$*\""
- _out=$($TEST_COMMAND_TRACE "${CTDB_BASE}/events.d/$script" "$event" "$@" 2>&1)
+ _trace=""
+ if $TEST_COMMAND_TRACE ; then
+ _trace="sh -x"
+ fi
+ _out=$($_trace "${CTDB_BASE}/events.d/$script" "$event" "$@" 2>&1)
result_check "$_extra_header"
}
Run only the specified tests.
-* ONNODE="bash -x stubs/onnode-buggy-001" ../run_tests.sh ./0090.sh
- ONNODE="bash -x ../../tools/onnode" ../run_tests.sh ./0090.sh
+* ONNODE="stubs/onnode-buggy-001" ../run_tests.sh -X ./0090.sh
+ ../run_tests.sh -X ./0090.sh
- Debug the specified test or test failure. The test will fail
- because the bash trace output will be included in the test output.
- However, this at least makes it easy to trace onnode while running
- the test...
+ Debug the specified test or test failure by tracing onnode with
+ "bash -x". The test will fail because the bash trace output will be
+ included in the test output.
- To see if the test pases, the -x can be dropped... so command-line
- editing can be kept to a minimum.
+ To see if the test pases, the -X can be dropped...
_sort="sort"
fi
- _out=$("$@" 2>&1)
+ if $TEST_COMMAND_TRACE ; then
+ _onnode=$(which "$1") ; shift
+ _out=$(bash -x "$_onnode" "$@" 2>&1)
+ else
+ _out=$("$@" 2>&1)
+ fi
_rc=$?
_out=$(echo "$_out" | $_sort )
no_header=false
export TEST_VERBOSE=false
-export TEST_COMMAND_TRACE=""
+export TEST_COMMAND_TRACE=false
export TEST_CAT_RESULTS_OPTS=""
export TEST_DIFF_RESULTS=false
export TEST_LOCAL_DAEMONS # No default, developer can "override"!
-q) quiet=true ; shift ;;
-s) with_summary=true ; shift ;;
-v) TEST_VERBOSE=true ; shift ;;
- -X) TEST_COMMAND_TRACE="sh -x" ; shift ;;
+ -X) TEST_COMMAND_TRACE=true ; shift ;;
-A) TEST_CAT_RESULTS_OPTS="-A" ; shift ;;
-D) TEST_DIFF_RESULTS=true ; shift ;;
-H) no_header=true ; shift ;;