summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-04-19 12:10:25 +1000
committerMartin Schwenke <martin@meltin.net>2012-04-27 15:40:43 +1000
commit4d08afa0beabf2af378880a422d8e7b94780c8e9 (patch)
treeba7fe8adcb5fb16ae62fb3fc163542e6e7712b7a
parentd4b102fe82192e42bb36185d2ccd9a0cd7b496b9 (diff)
downloadsamba-4d08afa0beabf2af378880a422d8e7b94780c8e9.tar.gz
samba-4d08afa0beabf2af378880a422d8e7b94780c8e9.tar.xz
samba-4d08afa0beabf2af378880a422d8e7b94780c8e9.zip
tests: Add new -H option for run_tests to avoid printing header/footer
This is useful for using run_tests to run one test at a time within an alternative test framework. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit dc71294a33e88baa4e85fa1fa66cab58a83c2607)
-rwxr-xr-xctdb/tests/scripts/run_tests9
1 files changed, 6 insertions, 3 deletions
diff --git a/ctdb/tests/scripts/run_tests b/ctdb/tests/scripts/run_tests
index f45afc35a4..2ad215dad9 100755
--- a/ctdb/tests/scripts/run_tests
+++ b/ctdb/tests/scripts/run_tests
@@ -13,6 +13,7 @@ Options:
-D Show diff between failed/expected test output (some tests only)
-X Trace certain scripts run by tests using -x (only some tests)
-d Print descriptions of tests instead of filenames (dodgy!)
+ -H No headers - for running single test with other wrapper
-q Quiet - don't show tests being run (hint: use with -s)
-x Trace this script with the -x option
EOF
@@ -31,6 +32,7 @@ with_summary=false
with_desc=false
quiet=false
exit_on_fail=false
+no_header=false
export TEST_VERBOSE=false
export TEST_COMMAND_TRACE=""
@@ -38,7 +40,7 @@ export TEST_CAT_RESULTS_OPTS=""
export TEST_DIFF_RESULTS=false
export TEST_LOCAL_DAEMONS # No default, developer can "override"!
-temp=$(getopt -n "$prog" -o "xdehlqsvXAD" -l help -- "$@")
+temp=$(getopt -n "$prog" -o "xdehlqsvXADH" -l help -- "$@")
[ $? != 0 ] && usage
@@ -56,6 +58,7 @@ while true ; do
-X) TEST_COMMAND_TRACE="sh -x" ; shift ;;
-A) TEST_CAT_RESULTS_OPTS="-A" ; shift ;;
-D) TEST_DIFF_RESULTS=true ; shift ;;
+ -H) no_header=true ; shift ;;
--) shift ; break ;;
*) usage ;;
esac
@@ -114,12 +117,12 @@ ctdb_test_run ()
[ -n "$1" ] || set -- "$name"
- ctdb_test_begin "$name"
+ $no_header || ctdb_test_begin "$name"
local status=0
"$@" || status=$?
- ctdb_test_end "$name" "$status" "$*"
+ $no_header || ctdb_test_end "$name" "$status" "$*"
return $status
}