aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2014-10-27 14:00:53 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-01 15:08:29 (GMT)
commita7fe868dae6ffe64dd9b127359b3e082da6a8ca6 (patch)
treea252dff92552757462af057e7b3aaa4fe468b042 /tests
parentee231fdb2bd7baef625a43677e013977c2de7c47 (diff)
downloadhostap-a7fe868dae6ffe64dd9b127359b3e082da6a8ca6.zip
hostap-a7fe868dae6ffe64dd9b127359b3e082da6a8ca6.tar.gz
hostap-a7fe868dae6ffe64dd9b127359b3e082da6a8ca6.tar.bz2
tests: Make run-all.sh arguments non-positional
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/hwsim/run-all.sh57
1 files changed, 37 insertions, 20 deletions
diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh
index 5ec3cf2..5efcd2e 100755
--- a/tests/hwsim/run-all.sh
+++ b/tests/hwsim/run-all.sh
@@ -24,30 +24,47 @@ else
fi
fi
-if [ "x$1" = "xvalgrind" ]; then
- VALGRIND=valgrind
+unset VALGRIND
+unset TRACE
+unset TRACE_ARGS
+unset RUN_TEST_ARGS
+while [ "$1" != "" ]; do
+ case $1 in
+ -v | --valgrind | valgrind)
+ shift
+ echo "$0: using valgrind"
+ VALGRIND=valgrind
+ ;;
+ -t | --trace | trace)
+ shift
+ echo "$0: using Trace"
+ TRACE=trace
+ ;;
+ -n | --channels)
+ shift
+ NUM_CH=$1
+ shift
+ echo "$0: using channels=$NUM_CH"
+ ;;
+ *)
+ RUN_TEST_ARGS="$RUN_TEST_ARGS$1 "
+ shift
+ ;;
+ esac
+done
+
+if [ ! -z "$RUN_TEST_ARGS" ]; then
+ echo "$0: passing the following args to run-tests.py: $RUN_TEST_ARGS"
+fi
+
+unset SUFFIX
+if [ ! -z "$VALGRIND" ]; then
SUFFIX=-valgrind
- shift
-else
- unset VALGRIND
- SUFFIX=
fi
-if [ "x$1" = "xtrace" ] ; then
- TRACE=trace
+if [ ! -z "$TRACE" ]; then
SUFFIX=$SUFFIX-trace
TRACE_ARGS="-T"
- shift
-else
- unset TRACE
- unset TRACE_ARGS
-fi
-
-NUM_CH=$1
-if [ x${NUM_CH%=[0-9]*} = "xchannels" ]; then
- shift
-else
- unset NUM_CH
fi
if ! ./start.sh $VALGRIND $TRACE $NUM_CH; then
@@ -57,7 +74,7 @@ if ! ./start.sh $VALGRIND $TRACE $NUM_CH; then
exit 1
fi
-sudo ./run-tests.py -D --logdir "$LOGDIR" $TRACE_ARGS -q $DB $@ || errors=1
+sudo ./run-tests.py -D --logdir "$LOGDIR" $TRACE_ARGS -q $DB $RUN_TEST_ARGS || errors=1
./stop.sh