Skip to content
Snippets Groups Projects
Commit 7282d755 authored by Kostyantyn Vorobyov's avatar Kostyantyn Vorobyov
Browse files

[tests] Performace updates in testrun.sh

parent 8a1c962a
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,9 @@ run_executable() { ...@@ -103,7 +103,9 @@ run_executable() {
local log="$2" local log="$2"
local model="$3" local model="$3"
debug "Run and log $executable" debug "Run: $executable"
debug "Log: $log"
if ! `$executable > $log 2>&1`; then if ! `$executable > $log 2>&1`; then
error "[$3 model] Runtime failure in test case '$TEST'" $log error "[$3 model] Runtime failure in test case '$TEST'" $log
fi fi
...@@ -119,27 +121,33 @@ run_test() { ...@@ -119,27 +121,33 @@ run_test() {
local model="$1" # Memory model to link against local model="$1" # Memory model to link against
local extra="$2" # Additional arguments to e-acsl-gcc.sh local extra="$2" # Additional arguments to e-acsl-gcc.sh
# Command for instrumenting the source file and compiling the original # e-acsl-gcc.sh reports models as space-separated string. Make a
# and the instrumented code # comma-separated one otherwise the following does not work
COMMAND="$EACSLGCC \ MODELSTR="$(echo $MODELS | tr ' ' ',')"
--compile $TESTFILE --ocode=$ocode --logfile=$logfile \
--instrumented-only --memory-model=$model --oexec=$oexec $extra" # Command for instrumenting the source file
COMMAND="$EACSLGCC $TESTFILE --ocode=$ocode --logfile=$logfile $extra"
debug "Run $COMMAND" debug "Run $COMMAND"
$COMMAND || error "Command $COMMAND failed" "$logfile" $COMMAND || error "Command $COMMAND failed" "$logfile"
# Log outputs of the generated executables # Compile instrumented source and run executable
run_executable "$oexec.e-acsl" "$oexeclog.e-acsl" "$model" for model in $MODELS; do
# Command for compiling the instrumented file with a given memory model
COMMAND="$EACSLGCC --compile-only --memory-model=$model --logfile=$logfile \
--oexec-e-acsl=$oexec-$model $ocode"
debug "Run $COMMAND"
$COMMAND || error "Command $COMMAND failed" "$logfile"
run_executable $oexec-$model $oexeclog-$model $model
done
RUNS=$((RUNS+1)) RUNS=$((RUNS+1))
} }
for model in $MODELS; do run_test $model "$EXTRA"
run_test $model "$EXTRA" # Run GMP tests if specified
# Run GMP tests if specified if [ -n "$GMP" ]; then
if [ -n "$GMP" ]; then run_test $model "--gmp $EXTRA"
run_test $model "--gmp $EXTRA" fi
fi
done
exit 0 exit 0
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