1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/tests/run_tests.sh
Martin Schwenke af2ab74beb tests: Allow run_tests.sh to take options
However, options must be followed by "--".

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit db8cf8f5e644a0b21a6040287887fee40f38d4db)
2012-05-11 10:33:27 +10:00

33 lines
703 B
Bash
Executable File

#!/bin/sh
test_dir=$(dirname "$0")
# Allow options to be passed to this script. However, if any options
# are passed there must be a "--" between the options and the tests.
# This makes it easy to handle options that take arguments.
opts=""
case "$1" in
-*)
while [ -n "$1" ] ; do
case "$1" in
--) shift ; break ;;
*) opts="$opts $1" ; shift ;;
esac
done
esac
if [ -n "$1" ] ; then
"${test_dir}/scripts/run_tests" -l -s $opts "$@" || exit 1
else
cd "$test_dir"
# By default, run all unit tests and the tests against local
# daemons
dirs="onnode takeover tool eventscripts simple"
./scripts/run_tests -l -s $opts $dirs || exit 1
fi
echo "All OK"
exit 0