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

[tests] minor changes into bin/test.sh

parent be3c4d88
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,8 @@ DUNE_LOG=./.test-errors.log ...@@ -35,6 +35,8 @@ DUNE_LOG=./.test-errors.log
CACHEDIR=$(pwd -P)/.wp-cache CACHEDIR=$(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/*"
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# --- Help Message # --- Help Message
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
...@@ -121,6 +123,13 @@ function Cmd ...@@ -121,6 +123,13 @@ function Cmd
[ "$?" = "0" ] || Error "(command exits $?): $@" [ "$?" = "0" ] || Error "(command exits $?): $@"
} }
function RequiredTools
{
for tool in $@ ; do
Where=$(which $tool) || Error "Executable not found: $tool"
done
}
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# --- WP Cache Environment # --- WP Cache Environment
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
...@@ -154,6 +163,7 @@ function CloneCache ...@@ -154,6 +163,7 @@ function CloneCache
{ {
if [ ! -d "$FRAMAC_WP_CACHEDIR" ]; then if [ ! -d "$FRAMAC_WP_CACHEDIR" ]; then
Head "Cloning WP cache (from $FRAMAC_WP_CACHE_GIT to $FRAMAC_WP_CACHEDIR)..." Head "Cloning WP cache (from $FRAMAC_WP_CACHE_GIT to $FRAMAC_WP_CACHEDIR)..."
RequiredTools git
Cmd git clone $FRAMAC_WP_CACHE_GIT $FRAMAC_WP_CACHEDIR Cmd git clone $FRAMAC_WP_CACHE_GIT $FRAMAC_WP_CACHEDIR
fi fi
} }
...@@ -162,6 +172,7 @@ function PullCache ...@@ -162,6 +172,7 @@ function PullCache
{ {
CloneCache CloneCache
Head "Pull WP cache (to $FRAMAC_WP_CACHEDIR)..." Head "Pull WP cache (to $FRAMAC_WP_CACHEDIR)..."
RequiredTools git
Run git -C $FRAMAC_WP_CACHEDIR pull --rebase Run git -C $FRAMAC_WP_CACHEDIR pull --rebase
} }
...@@ -277,7 +288,7 @@ function Status ...@@ -277,7 +288,7 @@ function Status
#-- Details #-- Details
Head "Details by directory:" Head "Details by directory:"
if [ "$NB" != "0" ]; then if [ "$NB" != "0" ]; then
for dir in tests/* src/plugins/*/tests/* ; do for dir in $TEST_DIRS ; do
if [ -d "$dir" ]; then if [ -d "$dir" ]; then
NB=$(grep -c "^frama-c-wtests $dir" "$1") NB=$(grep -c "^frama-c-wtests $dir" "$1")
[ "$NB" = "0" ] || echo "- $dir= $NB" [ "$NB" = "0" ] || echo "- $dir= $NB"
...@@ -293,7 +304,8 @@ function Status ...@@ -293,7 +304,8 @@ function Status
#-- Check wp-cache status #-- Check wp-cache status
if [ "$UPDATE" = "yes" ]; then if [ "$UPDATE" = "yes" ]; then
Head "Check $FRAMAC_WP_CACHEDIR status" Head "Check $FRAMAC_WP_CACHEDIR status"
git -C $FRAMAC_WP_CACHEDIR status -s RequiredTools git
Run git -C $FRAMAC_WP_CACHEDIR status -s
fi fi
} }
...@@ -343,7 +355,12 @@ do ...@@ -343,7 +355,12 @@ do
shift shift
;; ;;
"-a"|"--all") "-a"|"--all")
TESTS="tests src/plugins/*/tests" TESTS=""
for dir in $TEST_DIRS ; do
if [ -d "$dir" ]; then
TESTS="$TESTS $dir"
fi
done
;; ;;
*) *)
TESTS+=" $1" TESTS+=" $1"
......
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