diff options
author | Martin Schwenke <martin@meltin.net> | 2018-01-22 19:48:02 +1100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2018-02-12 11:28:49 +0100 |
commit | 74e2d615d134b56ccdbf4ae8d91c46a1c387eb7c (patch) | |
tree | 8b220f7ce72c7707d56c4d7340230bc0d4bc2064 /ctdb/tests/run_tests.sh | |
parent | 10ffffa6c00a890b46c22ea87e4653953d0948c2 (diff) | |
download | samba-74e2d615d134b56ccdbf4ae8d91c46a1c387eb7c.tar.gz |
ctdb-tests: Add a UNIT pseudo-test-suite
This runs all of the unit tests.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 50150d75814de6a1e2cb28fb7af72caa31d73e3c)
Diffstat (limited to 'ctdb/tests/run_tests.sh')
-rwxr-xr-x | ctdb/tests/run_tests.sh | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index a133445a132..a2a44a13e4a 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -254,13 +254,23 @@ echo "TEST_VAR_DIR=$TEST_VAR_DIR" export TEST_SCRIPTS_DIR="${CTDB_TEST_DIR}/scripts" +unit_tests=" + cunit + eventd + eventscripts + onnode + shellcheck + takeover + takeover_helper + tool +" + # If no tests specified then run some defaults if [ -z "$1" ] ; then - if [ -n "$TEST_LOCAL_DAEMONS" ] ; then - set -- onnode takeover takeover_helper tool eventscripts \ - cunit eventd shellcheck simple - else - set -- simple complex + if [ -n "$TEST_LOCAL_DAEMONS" ] ; then + set -- UNIT simple + else + set -- simple complex fi fi @@ -287,7 +297,19 @@ cleanup_handler () trap cleanup_handler SIGINT SIGTERM +declare -a tests +i=0 for f ; do + if [ "$f" = "UNIT" ] ; then + for t in $unit_tests ; do + tests[i++]="$t" + done + else + tests[i++]="$f" + fi +done + +for f in "${tests[@]}" ; do find_and_run_one_test "$f" if [ $status -eq 127 ] ; then |