Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
e2928ed8
Commit
e2928ed8
authored
1 year ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[dev] refactor bin/test
parent
363f3d46
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/test.sh
+106
-71
106 additions, 71 deletions
bin/test.sh
with
106 additions
and
71 deletions
bin/test.sh
+
106
−
71
View file @
e2928ed8
...
...
@@ -24,6 +24,9 @@
THIS_SCRIPT
=
"
$0
"
CONFIG
=
"<all>"
VERBOSE
=
CLEAN
=
PREPARE
=
PULLCACHE
=
UPDATE
=
LOGS
=
COMMIT
=
...
...
@@ -130,6 +133,70 @@ function RequiredTools
done
}
# --------------------------------------------------------------------------
# --- Command Line Processing
# --------------------------------------------------------------------------
while
[
"
$1
"
!=
""
]
do
case
"
$1
"
in
"-h"
|
"-help"
|
"--help"
)
Usage
exit
0
;;
"-r"
|
"--clean"
)
CLEAN
=
yes
PREPARE
=
yes
;;
"-p"
|
"--ptests"
)
PREPARE
=
yes
;;
"-w"
|
"--wp-cache"
)
PULLCACHE
=
yes
;;
"-u"
|
"--update"
)
DUNE_OPT+
=
"--auto-promote"
UPDATE
=
yes
;;
"-v"
|
"--verbose"
)
DUNE_OPT+
=
"--display=short"
VERBOSE
=
yes
;;
"-l"
|
"--logs"
)
LOGS
=
yes
;;
"-k"
|
"--commit"
)
COMMIT
=
yes
;;
"-s"
|
"--save"
)
SAVE
=
yes
;;
"-d"
|
"--default"
)
CONFIG
=
"<default>"
;;
"-c"
|
"--config"
)
CONFIG
=
$2
shift
;;
"-n"
|
"--name"
)
ALIAS_NAME
=
$2
shift
;;
"-a"
|
"--all"
)
TESTS
=
""
for
dir
in
$TEST_DIRS
;
do
if
[
-d
"
$dir
"
]
;
then
TESTS
=
"
$TESTS
$dir
"
fi
done
;;
*
)
TESTS+
=
"
$1
"
;;
esac
shift
done
# --------------------------------------------------------------------------
# --- WP Cache Environment
# --------------------------------------------------------------------------
...
...
@@ -138,19 +205,25 @@ function SetEnv
{
if
[
"
$FRAMAC_WP_CACHE
"
=
""
]
;
then
if
[
"
$UPDATE
"
=
"yes"
]
;
then
Head
"FRAMAC_WP_CACHE=update"
export
FRAMAC_WP_CACHE
=
update
else
export
FRAMAC_WP_CACHE
=
offline
fi
Echo
"Set FRAMAC_WP_CACHE=
$FRAMAC_WP_CACHE
"
else
if
[
"
$UPDATE
"
=
"yes"
]
;
then
Head
"FRAMAC_WP_CACHE=
$FRAMAC_WP_CACHE
(overrides -u)"
else
Head
"FRAMAC_WP_CACHE=
$FRAMAC_WP_CACHE
"
fi
fi
if
[
"
$FRAMAC_WP_QUALIF
"
!=
""
]
;
then
export
FRAMAC_WP_CACHEDIR
=
"
$FRAMAC_WP_QUALIF
"
Echo
"
Set
FRAMAC_WP_CACHEDIR=
$FRAMAC_WP_CACHEDIR
"
Echo
"
#
FRAMAC_WP_CACHEDIR=
$FRAMAC_WP_CACHEDIR
"
elif
[
"
$FRAMAC_WP_CACHEDIR
"
=
""
]
;
then
export
FRAMAC_WP_CACHEDIR
=
"
$LOCAL_WP_CACHE
"
Echo
"
Set
FRAMAC_WP_CACHEDIR=
$FRAMAC_WP_CACHEDIR
"
Echo
"
#
FRAMAC_WP_CACHEDIR=
$FRAMAC_WP_CACHEDIR
"
fi
[
!
-f
"
$FRAMAC_WP_CACHEDIR
"
]
||
[
-d
"
$FRAMAC_WP_CACHEDIR
"
]
\
...
...
@@ -160,7 +233,6 @@ function SetEnv
/
*
);;
*
)
Error
"Requires an absolute path to
$FRAMAC_WP_CACHEDIR
"
;;
esac
}
function
CloneCache
...
...
@@ -174,10 +246,31 @@ function CloneCache
function
PullCache
{
CloneCache
Head
"Pull WP cache (to
$FRAMAC_WP_CACHEDIR
)..."
RequiredTools git
Run git
-C
$FRAMAC_WP_CACHEDIR
pull
--rebase
if
[
"
$PULLCACHE
"
=
"yes"
]
then
CloneCache
Head
"Pull WP cache (to
$FRAMAC_WP_CACHEDIR
)..."
RequiredTools git
Run git
-C
$FRAMAC_WP_CACHEDIR
pull
--rebase
fi
}
# --------------------------------------------------------------------------
# --- Test Suite Preparation
# --------------------------------------------------------------------------
function
PrepareTests
{
if
[
"
$CLEAN
"
=
"yes"
]
then
Head
"Cleaning all tests..."
Cmd make clean-tests
fi
if
[
"
$PREPARE
"
=
"yes"
]
then
Head
"Generating dune files..."
Cmd make run-ptests
fi
}
# --------------------------------------------------------------------------
...
...
@@ -338,73 +431,15 @@ function Status
}
# --------------------------------------------------------------------------
# ---
Command L
in
e
Pro
cessing
# ---
Ma
in Pro
gram
# --------------------------------------------------------------------------
SetEnv
while
[
"
$1
"
!=
""
]
do
case
"
$1
"
in
"-h"
|
"-help"
|
"--help"
)
Usage
exit
0
;;
"-r"
|
"--clean"
)
Head
"Cleaning all tests..."
Cmd make clean-tests
Head
"Generating dune files..."
Cmd make run-ptests
;;
"-p"
|
"--ptests"
)
Head
"Generating dune files..."
Cmd make run-ptests
;;
"-w"
|
"--wp-cache"
)
PullCache
;;
"-u"
|
"--update"
)
DUNE_OPT+
=
"--auto-promote"
UPDATE
=
yes
;;
"-v"
|
"--verbose"
)
DUNE_OPT+
=
"--display=short"
VERBOSE
=
yes
;;
"-l"
|
"--logs"
)
LOGS
=
yes
;;
"-k"
|
"--commit"
)
COMMIT
=
yes
;;
"-s"
|
"--save"
)
SAVE
=
yes
;;
"-d"
|
"--default"
)
CONFIG
=
"<default>"
;;
"-c"
|
"--config"
)
CONFIG
=
$2
shift
;;
"-n"
|
"--name"
)
ALIAS_NAME
=
$2
shift
;;
"-a"
|
"--all"
)
TESTS
=
""
for
dir
in
$TEST_DIRS
;
do
if
[
-d
"
$dir
"
]
;
then
TESTS
=
"
$TESTS
$dir
"
fi
done
;;
*
)
TESTS+
=
"
$1
"
;;
esac
shift
done
PullCache
PrepareTests
Register
$TESTS
RunAlias
${
DUNE_ALIAS
}
Commits
${
COMMITS
}
Status
$DUNE_LOG
# --------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment