Skip to content
Snippets Groups Projects
Commit a3823c75 authored by Patrick Baudin's avatar Patrick Baudin
Browse files

Merge branch 'fix/test/promotion-when-using-test-script' into 'master'

[test] Fixes promoting when using test script

Closes #1153

See merge request frama-c/frama-c!3898
parents e88b2108 e3c7d4e1
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ LOGS= ...@@ -29,6 +29,7 @@ LOGS=
TESTS= TESTS=
SAVE= SAVE=
DUNE_ALIAS=
DUNE_OPT= DUNE_OPT=
DUNE_LOG=./.test-errors.log DUNE_LOG=./.test-errors.log
CACHEDIR=$(pwd -P)/.wp-cache CACHEDIR=$(pwd -P)/.wp-cache
...@@ -169,9 +170,10 @@ function PullCache ...@@ -169,9 +170,10 @@ function PullCache
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
[ "$DUNE_LOG" = "" ] || rm -rf $DUNE_LOG [ "$DUNE_LOG" = "" ] || rm -rf $DUNE_LOG
function TestAlias function RunAlias
{ {
Head "Running tests..."
if [ "$DUNE_LOG" = "" ]; then if [ "$DUNE_LOG" = "" ]; then
Run dune build $DUNE_OPT $@ Run dune build $DUNE_OPT $@
elif [ "$SAVE" != "yes" ] && [ "$VERBOSE" != "yes" ]; then elif [ "$SAVE" != "yes" ] && [ "$VERBOSE" != "yes" ]; then
...@@ -204,8 +206,8 @@ function TestDir ...@@ -204,8 +206,8 @@ function TestDir
CFG="(config $CONFIG)" CFG="(config $CONFIG)"
;; ;;
esac esac
Head "Running test on directory $1 $CFG" Head "Register test on directory $1 $CFG"
TestAlias @$ALIAS DUNE_ALIAS="${DUNE_ALIAS} @$ALIAS"
} }
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
...@@ -231,17 +233,17 @@ function TestFile ...@@ -231,17 +233,17 @@ function TestFile
if [ "$LOGS" = "yes" ]; then if [ "$LOGS" = "yes" ]; then
ALIAS=$DIR/$RESULT/$FILE ALIAS=$DIR/$RESULT/$FILE
else else
ALIAS=$DIR/$RESULT/${FILE%.*}.wtests ALIAS=$DIR/$RESULT/${FILE%.*}.diff
fi fi
Head "Running test on file $1 $CFG" Head "Register test on file $1 $CFG"
TestAlias @$ALIAS DUNE_ALIAS="${DUNE_ALIAS} @$ALIAS"
} }
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# --- Tests Processing # --- Tests Processing
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
function RunTests function Register
{ {
while [ "$1" != "" ] while [ "$1" != "" ]
do do
...@@ -251,7 +253,7 @@ function RunTests ...@@ -251,7 +253,7 @@ function RunTests
TestFile $1 TestFile $1
else else
case $1 in case $1 in
@*) Head "Running test on alias $1"; TestAlias $1;; @*) Head "Register test on alias $1"; DUNE_ALIAS="${DUNE_ALIAS} $1";;
*) ErrorUsage "ERROR: don't known what to do with '$1'";; *) ErrorUsage "ERROR: don't known what to do with '$1'";;
esac esac
fi fi
...@@ -349,5 +351,6 @@ do ...@@ -349,5 +351,6 @@ do
esac esac
shift shift
done done
RunTests $TESTS Register $TESTS
RunAlias ${DUNE_ALIAS}
Status $DUNE_LOG Status $DUNE_LOG
...@@ -48,7 +48,7 @@ The `./bin/test.sh` uses, in order of proprity: ...@@ -48,7 +48,7 @@ The `./bin/test.sh` uses, in order of proprity:
- `FRAMAC_WP_CACHEDIR` environement variable, - `FRAMAC_WP_CACHEDIR` environement variable,
- local `./.wp-cache` directory. - local `./.wp-cache` directory.
Of course, these environment variables must be set to an absolute path to prevent from different execution locations of Frama-C. Of course, these environment variables must be set to an absolute path since test executions are done from different directories.
It is _not_ recommended to use the `FRAMAC_WP_CACHEDIR` variable in your default It is _not_ recommended to use the `FRAMAC_WP_CACHEDIR` variable in your default
shell setup, unless is it a temporary directory (eg. `/tmp/wp-sandbox`) since shell setup, unless is it a temporary directory (eg. `/tmp/wp-sandbox`) since
......
/* run.config /* run.config
COMMENT: with dune, the LIBS directive must be replaced by a MODULE directive (see also ./test_config file) COMMENT: note: the module global_decl_loc is also used by another test file (global_decl_loc2.i)
MODULE: global_decl_loc MODULE: global_decl_loc
OPT: %{dep:./global_decl_loc2.i} OPT: %{dep:./global_decl_loc2.i}
*/ */
......
/* run.config* /* run.config*
COMMENT: with dune, the LIBS directive must be replaced by a MODULE directive (see also ./test_config file) COMMENT: note: the module global_decl_loc is also used by another test file (global_decl_loc.i)
MODULE: global_decl_loc MODULE: global_decl_loc
OPT: %{dep:./global_decl_loc.i} OPT: %{dep:./global_decl_loc.i}
......
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