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
8a1c962a
Commit
8a1c962a
authored
8 years ago
by
Kostyantyn Vorobyov
Browse files
Options
Downloads
Patches
Plain Diff
[tests] Enable testing using all supported memory models
parent
2a3da5cf
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
src/plugins/e-acsl/scripts/testrun.sh
+21
-16
21 additions, 16 deletions
src/plugins/e-acsl/scripts/testrun.sh
with
21 additions
and
16 deletions
src/plugins/e-acsl/scripts/testrun.sh
+
21
−
16
View file @
8a1c962a
...
@@ -52,11 +52,13 @@ GMP="$3" # Whether to issue an additional run with -e-acsl-gmp-only
...
@@ -52,11 +52,13 @@ GMP="$3" # Whether to issue an additional run with -e-acsl-gmp-only
EXTRA
=
"
$4
"
# Extra e-acsl-gcc.sh flags
EXTRA
=
"
$4
"
# Extra e-acsl-gcc.sh flags
DEBUG
=
"
$5
"
# Debug option
DEBUG
=
"
$5
"
# Debug option
EACSLGCC
=
"
$(
dirname
$0
)
/e-acsl-gcc.sh"
# E-ACSL wrapper script
MODELS
=
"
$(
$EACSLGCC
--print-mmodels
)
"
# Supported memory models
ROOTDIR
=
"
`
readlink
-f
$(
dirname
$0
)
/../
`
"
# Root directory of the repository
ROOTDIR
=
"
`
readlink
-f
$(
dirname
$0
)
/../
`
"
# Root directory of the repository
TESTDIR
=
"
$ROOTDIR
/tests/
$PREFIX
"
# Test suite directory
TESTDIR
=
"
$ROOTDIR
/tests/
$PREFIX
"
# Test suite directory
RESDIR
=
$TESTDIR
/result
# Result directory within the test suite
RESDIR
=
$TESTDIR
/result
# Result directory within the test suite
TESTFILE
=
`
ls
$TESTDIR
/
$TEST
.[ic]
`
# Source test file
TESTFILE
=
`
ls
$TESTDIR
/
$TEST
.[ic]
`
# Source test file
MODEL
=
"bittree"
# Memory model to link against
LOG
=
"
$RESDIR
/
$TEST
.testrun"
# Base name for log files
LOG
=
"
$RESDIR
/
$TEST
.testrun"
# Base name for log files
OUT
=
"
$RESDIR
/gen_
$TEST
"
# Base name for instrumented files
OUT
=
"
$RESDIR
/gen_
$TEST
"
# Base name for instrumented files
...
@@ -95,16 +97,15 @@ trap "clean" EXIT HUP INT QUIT TERM
...
@@ -95,16 +97,15 @@ trap "clean" EXIT HUP INT QUIT TERM
# Run executable and report results
# Run executable and report results
# $1 - path to an executable
# $1 - path to an executable
# $2 - path to a log file
# $2 - path to a log file
# $3 - type of the executable (i.e., generated from original or instrumented
# $3 - memory model the executable has been linked against
# sources)
run_executable
()
{
run_executable
()
{
local
executable
=
"
$1
"
local
executable
=
"
$1
"
local
log
=
"
$2
"
local
log
=
"
$2
"
local
type
=
"
$3
"
local
model
=
"
$3
"
debug
"Run and log
$executable
"
debug
"Run and log
$executable
"
if
!
`
$executable
>
$log
2>&1
`
;
then
if
!
`
$executable
>
$log
2>&1
`
;
then
error
"[
$3
run]:
Runtime failure in test case
$TEST
:
"
$log
error
"[
$3
model]
Runtime failure in test case
'
$TEST
'
"
$log
fi
fi
}
}
...
@@ -115,26 +116,30 @@ run_test() {
...
@@ -115,26 +116,30 @@ run_test() {
local
logfile
=
$LOG
.
$RUNS
.elog
# Log file for e-acsl-gcc.sh output
local
logfile
=
$LOG
.
$RUNS
.elog
# Log file for e-acsl-gcc.sh output
local
oexec
=
$OUT
.
$RUNS
.out
# Generated executable name
local
oexec
=
$OUT
.
$RUNS
.out
# Generated executable name
local
oexeclog
=
$LOG
.
$RUNS
.rlog
# Log for executable output
local
oexeclog
=
$LOG
.
$RUNS
.rlog
# Log for executable output
local
extra
=
"
$1
"
# Additional arguments to e-acsl-gcc.sh
local
model
=
"
$1
"
# Memory model to link against
local
extra
=
"
$2
"
# Additional arguments to e-acsl-gcc.sh
# Command for instrumenting the source file and compiling the original
# Command for instrumenting the source file and compiling the original
# and the instrumented code
# and the instrumented code
EACSL
_
GCC
=
"./scripts/e-acsl-gcc.sh
\
COMMAND
=
"
$
EACSLGCC
\
--compile
$TESTFILE
--ocode=
$ocode
--logfile=
$logfile
\
--compile
$TESTFILE
--ocode=
$ocode
--logfile=
$logfile
\
--instrumented-only --memory-model=
$
MODEL
--oexec=
$oexec
$extra
"
--instrumented-only --memory-model=
$
model
--oexec=
$oexec
$extra
"
debug
"Run
$
EACSL_GCC
"
debug
"Run
$
COMMAND
"
$
EACSL_GCC
||
error
"Command
$
EACSL_GCC
failed"
"
$logfile
"
$
COMMAND
||
error
"Command
$
COMMAND
failed"
"
$logfile
"
# Log outputs of the generated executables
# Log outputs of the generated executables
run_executable
$oexec
.e-acsl
$oexeclog
.e-acsl
"
Instrumented
"
run_executable
"
$oexec
.e-acsl
"
"
$oexeclog
.e-acsl
"
"
$model
"
RUNS
=
$((
RUNS+1
))
RUNS
=
$((
RUNS+1
))
}
}
# Run GMP tests if specified
for
model
in
$MODELS
;
do
run_test
"
$EXTRA
"
run_test
$model
"
$EXTRA
"
if
[
-n
"
$GMP
"
]
;
then
# Run GMP tests if specified
run_test
"--gmp
$EXTRA
"
if
[
-n
"
$GMP
"
]
;
then
fi
run_test
$model
"--gmp
$EXTRA
"
fi
done
exit
0
exit
0
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