Skip to content
Snippets Groups Projects
Commit 0323df08 authored by Thibault Martin's avatar Thibault Martin
Browse files

[script] Add option --, all following args are passed to dune

parent 26fed94a
No related branches found
No related tags found
Loading
...@@ -38,6 +38,7 @@ JSON= ...@@ -38,6 +38,7 @@ JSON=
DUNE_ALIAS= DUNE_ALIAS=
DUNE_OPT= DUNE_OPT=
DUNE_OPT_POST=
DUNE_LOG=./.test-errors.log DUNE_LOG=./.test-errors.log
ALIAS_NAME=ptests ALIAS_NAME=ptests
LOCAL_WP_CACHE=$(pwd -P)/.wp-cache LOCAL_WP_CACHE=$(pwd -P)/.wp-cache
...@@ -88,6 +89,12 @@ function Usage ...@@ -88,6 +89,12 @@ function Usage
echo " --coverage-json compute test coverage in Coveralls JSON format" echo " --coverage-json compute test coverage in Coveralls JSON format"
echo " -h|--help print this help" echo " -h|--help print this help"
echo "" echo ""
echo "TRAILING OPTIONS"
echo ""
echo " All arguments passed after a double dash '--' are passed to dune"
echo " For example in 'test.sh -r -u tests -- -j 12', '-j 12' will be"
echo " passed as a dune argument"
echo ""
echo "VARIABLES" echo "VARIABLES"
echo "" echo ""
echo " FRAMAC_WP_CACHE" echo " FRAMAC_WP_CACHE"
...@@ -224,6 +231,10 @@ do ...@@ -224,6 +231,10 @@ do
"eva") "eva")
TESTS+=" tests/value tests/builtins tests/float tests/idct" TESTS+=" tests/value tests/builtins tests/float tests/idct"
;; ;;
"--")
shift
break
;;
*) *)
if [ -f $1 ] || [ -d $1 ]; then if [ -f $1 ] || [ -d $1 ]; then
TESTS+=" $1" TESTS+=" $1"
...@@ -239,6 +250,9 @@ do ...@@ -239,6 +250,9 @@ do
shift shift
done done
# Pass all the remaining options (after '--') to dune at the end of the command
DUNE_OPT_POST="$@"
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# --- WP Cache Environment # --- WP Cache Environment
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
...@@ -398,13 +412,13 @@ function RunAlias ...@@ -398,13 +412,13 @@ function RunAlias
{ {
Head "Running tests..." Head "Running tests..."
if [ "$DUNE_LOG" = "" ]; then if [ "$DUNE_LOG" = "" ]; then
Run dune build $DUNE_OPT $@ Run dune build $DUNE_OPT $@ $DUNE_OPT_POST
elif [ "$SAVE" != "yes" ] && [ "$VERBOSE" != "yes" ]; then elif [ "$SAVE" != "yes" ] && [ "$VERBOSE" != "yes" ]; then
Run dune build $DUNE_OPT $@ Run dune build $DUNE_OPT $@ $DUNE_OPT_POST
else else
# note: the Run function cannot performs redirection # note: the Run function cannot performs redirection
echo "> dune build $DUNE_OPT $@ 2> >(tee -a $DUNE_LOG >&2)" echo "> dune build $DUNE_OPT $@ $DUNE_OPT_POST 2> >(tee -a $DUNE_LOG >&2)"
dune build $DUNE_OPT $@ 2> >(tee -a $DUNE_LOG >&2) dune build $DUNE_OPT $@ $DUNE_OPT_POST 2> >(tee -a $DUNE_LOG >&2)
fi fi
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment