Skip to content
Snippets Groups Projects
Commit a659e439 authored by Julien Signoles's avatar Julien Signoles
Browse files

[tests] do not execute the non-instrumented code

parent 233f1943
No related branches found
No related tags found
No related merge requests found
...@@ -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 sources # 2. Run executables generated from the instrumented source
# and compare their outputs # and check 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 compare outputs of the # Instrument the given test using e-acsl-gcc.sh and check that the generated
# executables generated from instrumented and non-instrumented sources # executable stops with a zero exit status
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))
} }
......
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