Skip to content
Snippets Groups Projects
Commit 363f3d46 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[tests] dune auto-promote on -u

parent 3396bd22
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ DUNE_ALIAS= ...@@ -34,7 +34,7 @@ DUNE_ALIAS=
DUNE_OPT= DUNE_OPT=
DUNE_LOG=./.test-errors.log DUNE_LOG=./.test-errors.log
ALIAS_NAME=ptests ALIAS_NAME=ptests
CACHEDIR=$(pwd -P)/.wp-cache LOCAL_WP_CACHE=$(pwd -P)/.wp-cache
FRAMAC_WP_CACHE_GIT=git@git.frama-c.com:frama-c/wp-cache.git FRAMAC_WP_CACHE_GIT=git@git.frama-c.com:frama-c/wp-cache.git
TEST_DIRS="tests/* src/plugins/*/tests/* src/kernel_internals/parsing/tests" TEST_DIRS="tests/* src/plugins/*/tests/* src/kernel_internals/parsing/tests"
...@@ -56,7 +56,7 @@ function Usage ...@@ -56,7 +56,7 @@ function Usage
echo " <DIR> all tests in <DIR>" echo " <DIR> all tests in <DIR>"
echo " <FILE> single test file <FILE>" echo " <FILE> single test file <FILE>"
echo "" echo ""
echo " -a|--all run all tests" echo " -a|--all run all tests (default behavior)"
echo " -d|--default run tests from default config only" echo " -d|--default run tests from default config only"
echo " -c|--config <name> run tests from specified config only" echo " -c|--config <name> run tests from specified config only"
echo "" echo ""
...@@ -67,9 +67,8 @@ function Usage ...@@ -67,9 +67,8 @@ function Usage
echo " -r|--clean clean (remove all) test results (includes -p)" echo " -r|--clean clean (remove all) test results (includes -p)"
echo " -p|--ptests prepare (all) dune files" echo " -p|--ptests prepare (all) dune files"
echo " -w|--wp-cache prepare (pull) WP-cache" echo " -w|--wp-cache prepare (pull) WP-cache"
echo " -u|--wp-update update (pull+add) WP-cache"
echo " -l|--logs print output of tests (single file, no diff)" echo " -l|--logs print output of tests (single file, no diff)"
echo " -k|--commit commit results as oracles (single file, no diff)" echo " -u|--update run tests and update oracles (and WP-cache)"
echo " -s|--save save dune logs into $DUNE_LOG" echo " -s|--save save dune logs into $DUNE_LOG"
echo " -v|--verbose print executed commands" echo " -v|--verbose print executed commands"
echo " -h|--help print this help" echo " -h|--help print this help"
...@@ -77,15 +76,11 @@ function Usage ...@@ -77,15 +76,11 @@ function Usage
echo "VARIABLES" echo "VARIABLES"
echo "" echo ""
echo " FRAMAC_WP_CACHE" echo " FRAMAC_WP_CACHE"
echo " Management mode of wp-cache ($FRAMAC_WP_CACHE)" echo " Management mode of wp-cache (default is offline or update when -u)"
echo "" echo ""
echo " FRAMAC_WP_QUALIF" echo " FRAMAC_WP_QUALIF"
echo " FRAMAC_WP_CACHEDIR" echo " FRAMAC_WP_CACHEDIR"
echo " Absolute path to wp-cache directory ($FRAMAC_WP_CACHEDIR)" echo " Absolute path to wp-cache directory (git clone locally by default)"
if [ ! -d $FRAMAC_WP_CACHEDIR ]; then
echo " About to clone from $FRAMAC_WP_CACHE_GIT"
fi
echo " Please, always push to master branch"
echo "" echo ""
} }
...@@ -142,7 +137,11 @@ function RequiredTools ...@@ -142,7 +137,11 @@ function RequiredTools
function SetEnv function SetEnv
{ {
if [ "$FRAMAC_WP_CACHE" = "" ]; then if [ "$FRAMAC_WP_CACHE" = "" ]; then
export FRAMAC_WP_CACHE=offline if [ "$UPDATE" = "yes" ]; then
export FRAMAC_WP_CACHE=update
else
export FRAMAC_WP_CACHE=offline
fi
Echo "Set FRAMAC_WP_CACHE=$FRAMAC_WP_CACHE" Echo "Set FRAMAC_WP_CACHE=$FRAMAC_WP_CACHE"
fi fi
...@@ -150,7 +149,7 @@ function SetEnv ...@@ -150,7 +149,7 @@ function SetEnv
export FRAMAC_WP_CACHEDIR="$FRAMAC_WP_QUALIF" export FRAMAC_WP_CACHEDIR="$FRAMAC_WP_QUALIF"
Echo "Set FRAMAC_WP_CACHEDIR=$FRAMAC_WP_CACHEDIR" Echo "Set FRAMAC_WP_CACHEDIR=$FRAMAC_WP_CACHEDIR"
elif [ "$FRAMAC_WP_CACHEDIR" = "" ]; then elif [ "$FRAMAC_WP_CACHEDIR" = "" ]; then
export FRAMAC_WP_CACHEDIR="$CACHEDIR" export FRAMAC_WP_CACHEDIR="$LOCAL_WP_CACHE"
Echo "Set FRAMAC_WP_CACHEDIR=$FRAMAC_WP_CACHEDIR" Echo "Set FRAMAC_WP_CACHEDIR=$FRAMAC_WP_CACHEDIR"
fi fi
...@@ -363,9 +362,8 @@ do ...@@ -363,9 +362,8 @@ do
"-w"|"--wp-cache") "-w"|"--wp-cache")
PullCache PullCache
;; ;;
"-u"|"--wp-update") "-u"|"--update")
PullCache DUNE_OPT+="--auto-promote"
FRAMAC_WP_CACHE=update
UPDATE=yes UPDATE=yes
;; ;;
"-v"|"--verbose") "-v"|"--verbose")
......
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