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
5e6a78bf
Commit
5e6a78bf
authored
2 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[Script] bin/tests.sh - option -v gives more details
parent
3fef0f1f
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
+27
-29
27 additions, 29 deletions
bin/test.sh
with
27 additions
and
29 deletions
bin/test.sh
+
27
−
29
View file @
5e6a78bf
...
...
@@ -28,7 +28,8 @@ UPDATE=
LOGS
=
TESTS
=
VERBOSE_LOG
=
.test-errors.log
DUNE_OPT
=
DUNE_LOG
=
.test-errors.log
FRAMAC_WP_CACHE_GIT
=
git@git.frama-c.com:frama-c/wp-cache.git
...
...
@@ -150,18 +151,16 @@ function PullCache
# --- Test Dir Alias
# --------------------------------------------------------------------------
rm
-rf
$
VERBOS
E_LOG
[
"
$DUNE_LOG
"
=
""
]
||
rm
-rf
$
DUN
E_LOG
function
TestAlias
{
if
[
"
$VERBOSE
"
!=
"yes"
]
;
then
Run dune build
$@
elif
[
"
$VERBOSE_LOG
"
=
""
]
;
then
Run build
--display
short
if
[
"
$DUNE_LOG
"
=
""
]
;
then
Run dune build
$DUNE_OPT
$@
else
# note: the Run function cannot performs redirection
echo
"> build
--display short
$@
2> >(tee -a
$
VERBOS
E_LOG
>&2)"
dune build
--display
short
$@
2>
>(
tee
-a
$
VERBOS
E_LOG
>
&2
)
echo
">
dune
build
$DUNE_OPT
$@
2> >(tee -a
$
DUN
E_LOG
>&2)"
dune build
$DUNE_OPT
$@
2>
>(
tee
-a
$
DUN
E_LOG
>
&2
)
fi
}
...
...
@@ -246,28 +245,26 @@ function RunTests
# --- Tests Numbering
# --------------------------------------------------------------------------
function
CountTest
s
function
Statu
s
{
#-- Count number of .res.log files
if
[
"
$VERBOSE
"
=
"yes"
]
;
then
if
[
-f
"
$VERBOSE_LOG
"
]
;
then
echo
"# Number of executed frama-c-wtests=
$(
grep
-c
"^frama-c-wtests "
$VERBOSE_LOG
)
"
Cmd
rm
-f
$VERBOSE_LOG
fi
BUILD
=
_build/default
Head
"Number of *.{err,res}.log files by test directory..."
NB
=
for
dir
in
tests src/plugins/
*
/tests
;
do
if
[
-d
"
$dir
"
]
;
then
NB
=
"
$((
find
$BUILD
/
$dir
-
name
\*
.err.log
-
or
-
name
\*
.res.log
2
>
/
dev/null
)
|
wc
-
l
)
"
[ "
$NB
" = "
0
" ] || echo "
-
$dir
=
$NB
"
#-- Count number of executed tests
if
[
"
$1
"
!=
""
]
&&
[
-f
"
$1
"
]
;
then
if
[
"
$VERBOSE
"
=
"yes"
]
;
then
#-- Total
NB
=
$(
grep
-c
"^frama-c-wtests "
"
$1
"
)
Head
"Number of executed frama-c-wtests=
$NB
"
#-- Details
Head
"Details by directory:"
if
[
"
$NB
"
!=
"0"
]
;
then
for
dir
in
tests/
*
src/plugins/
*
/tests/
*
;
do
if
[
-d
"
$dir
"
]
;
then
NB
=
$(
grep
-c
"^frama-c-wtests
$dir
"
"
$1
"
)
[
"
$NB
"
=
"0"
]
||
echo
"-
$dir
=
$NB
"
fi
done
fi
done
[ "
$NB
" != "" ] || echo "
-
<none>
"
fi
Cmd
rm
-f
$1
fi
#-- Check wp-cache status
...
...
@@ -306,6 +303,7 @@ do
UPDATE
=
yes
;;
"-v"
|
"--verbose"
)
DUNE_OPT+
=
"--display=short"
VERBOSE
=
yes
;;
"-l"
|
"--logs"
)
...
...
@@ -328,4 +326,4 @@ do
shift
done
RunTests
$TESTS
CountTests
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