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
a659e439
Commit
a659e439
authored
9 years ago
by
Julien Signoles
Browse files
Options
Downloads
Patches
Plain Diff
[tests] do not execute the non-instrumented code
parent
233f1943
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
+5
-12
5 additions, 12 deletions
src/plugins/e-acsl/scripts/testrun.sh
with
5 additions
and
12 deletions
src/plugins/e-acsl/scripts/testrun.sh
+
5
−
12
View file @
a659e439
...
@@ -25,14 +25,13 @@
...
@@ -25,14 +25,13 @@
# Convenience script for running tests with E-ACSL. Given a source file the
# Convenience script for running tests with E-ACSL. Given a source file the
# sequence is as follows:
# sequence is as follows:
# 1. Instrument and compile a given source file with `e-acsl-gcc.sh`
# 1. Instrument and compile a given source file with `e-acsl-gcc.sh`
# 2. Run executables generated from the instrumented
and original
source
s
# 2. Run executables generated from the instrumented source
# and c
ompare their outputs
# and c
heck that it does not fail
# Test failure is detected if:
# Test failure is detected if:
# - `e-acsl-gcc.sh` fails (i.e., instrumentation- or compile-time failure)
# - `e-acsl-gcc.sh` fails (i.e., instrumentation- or compile-time failure)
# - A generated executable exists with a non-zero status
# - A generated executable exists with a non-zero status
# - Outputs produced by executables generated from the original and
# - The run of this executable stops with a non-zero exit status
# instrumented sources differ
# Arguments:
# Arguments:
# $1 - base name of a test source file excluding its extension (e.g., addrOf)
# $1 - base name of a test source file excluding its extension (e.g., addrOf)
...
@@ -109,8 +108,8 @@ run_executable() {
...
@@ -109,8 +108,8 @@ run_executable() {
fi
fi
}
}
# Instrument the given test using e-acsl-gcc.sh and c
ompare outputs of the
# Instrument the given test using e-acsl-gcc.sh and c
heck that the generated
# executable
s generated from instrumented and non-instrumented source
s
# executable
stops with a zero exit statu
s
run_test
()
{
run_test
()
{
local
ocode
=
$OUT
.
$RUNS
.c
# Generated source file
local
ocode
=
$OUT
.
$RUNS
.c
# Generated source file
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
...
@@ -128,14 +127,8 @@ run_test() {
...
@@ -128,14 +127,8 @@ run_test() {
$EACSL_GCC
||
error
"Command
$EACSL_GCC
failed"
"
$logfile
"
$EACSL_GCC
||
error
"Command
$EACSL_GCC
failed"
"
$logfile
"
# Log outputs of the generated executables
# Log outputs of the generated executables
run_executable
$oexec
$oexeclog
.native
"Native"
run_executable
$oexec
.e-acsl
$oexeclog
.e-acsl
"Instrumented"
run_executable
$oexec
.e-acsl
$oexeclog
.e-acsl
"Instrumented"
# Make sure that instrumented and uninstrumented programs have same outputs
debug
"Compare outputs of
$oexec
and
$oexec
.e-acsl"
diff
-ur
-N
$oexeclog
.native
$oexeclog
.e-acsl
>
$oexeclog
.diff 2>&1
||
\
error
"Output of instrumented and original programs differ"
$oexeclog
.diff
RUNS
=
$((
RUNS+1
))
RUNS
=
$((
RUNS+1
))
}
}
...
...
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