summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/run_tests.sh
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-05-10 14:55:19 +1000
committerMartin Schwenke <martin@meltin.net>2012-05-11 10:33:27 +1000
commitaf2ab74beb5da03e84e760ac92d45c9453a5e75d (patch)
treecb48347b5cfe98cc9363a7c92d8f557a8fff6fb3 /ctdb/tests/run_tests.sh
parentb713c11621bd9e1fcae535888421c0b3a09d014b (diff)
downloadsamba-af2ab74beb5da03e84e760ac92d45c9453a5e75d.tar.gz
samba-af2ab74beb5da03e84e760ac92d45c9453a5e75d.tar.xz
samba-af2ab74beb5da03e84e760ac92d45c9453a5e75d.zip
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)
Diffstat (limited to 'ctdb/tests/run_tests.sh')
-rwxr-xr-xctdb/tests/run_tests.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh
index f3cc840fb0..cd90bbbb97 100755
--- a/ctdb/tests/run_tests.sh
+++ b/ctdb/tests/run_tests.sh
@@ -2,8 +2,22 @@
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 "$@" || exit 1
+ "${test_dir}/scripts/run_tests" -l -s $opts "$@" || exit 1
else
cd "$test_dir"
@@ -11,7 +25,7 @@ else
# daemons
dirs="onnode takeover tool eventscripts simple"
- ./scripts/run_tests -l -s $dirs || exit 1
+ ./scripts/run_tests -l -s $opts $dirs || exit 1
fi
echo "All OK"