tests: Make run-all.sh arguments non-positional

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
This commit is contained in:
Ilan Peer 2014-10-27 10:00:53 -04:00 committed by Jouni Malinen
parent ee231fdb2b
commit a7fe868dae

View file

@ -24,30 +24,47 @@ else
fi fi
fi fi
if [ "x$1" = "xvalgrind" ]; then unset VALGRIND
VALGRIND=valgrind unset TRACE
SUFFIX=-valgrind unset TRACE_ARGS
shift unset RUN_TEST_ARGS
else while [ "$1" != "" ]; do
unset VALGRIND case $1 in
SUFFIX= -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 fi
if [ "x$1" = "xtrace" ] ; then unset SUFFIX
TRACE=trace if [ ! -z "$VALGRIND" ]; then
SUFFIX=-valgrind
fi
if [ ! -z "$TRACE" ]; then
SUFFIX=$SUFFIX-trace SUFFIX=$SUFFIX-trace
TRACE_ARGS="-T" 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 fi
if ! ./start.sh $VALGRIND $TRACE $NUM_CH; then if ! ./start.sh $VALGRIND $TRACE $NUM_CH; then
@ -57,7 +74,7 @@ if ! ./start.sh $VALGRIND $TRACE $NUM_CH; then
exit 1 exit 1
fi 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 ./stop.sh