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

- Added debug option to the testrun.sh

- Fixed inconsistency in the documentation of testrun.sh
parent 4d03bff9
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
# 3. Compare outputs of the above # 3. Compare outputs of the above
# Arguments: # Arguments:
# $1 - base name of the source file to use (e.g., addrOf) # $1 - base name of the source file to use excluding an
# extension (e.g., addrOf)
# $2 - base name of the test suite directory the test file is located in. # $2 - base name of the test suite directory the test file is located in.
# (for instance e-acsl-runtime). Provided that ROOT is the directory # (for instance e-acsl-runtime). Provided that ROOT is the directory
# holding the E-ACSL repository there should be either: # holding the E-ACSL repository there should be either:
...@@ -37,10 +38,14 @@ ...@@ -37,10 +38,14 @@
# $ROOT/test/e-acsl-runtime/addrOf.c # $ROOT/test/e-acsl-runtime/addrOf.c
# $3 - if specified this script re-runs test sequence generating using # $3 - if specified this script re-runs test sequence generating using
# -e-acsl-gmp-only option # -e-acsl-gmp-only option
# $4 - debug flag
PREFIX="$1" # Prefix (test suite) directory, e.g., bts, e-acsl-runtime set -e
TEST="$2" # Based name of the test file with extension stripped
TEST="$1" # Based name of the test file with extension stripped
PREFIX="$2" # Prefix (test suite) directory, e.g., bts, e-acsl-runtime
GMP="$3" # Whether to use a subsequent run with -e-acsl-gmp-only GMP="$3" # Whether to use a subsequent run with -e-acsl-gmp-only
DEBUG="$4" # Debug flag
ROOTDIR="`readlink -f $(dirname $0)/../`" # Root directory of the repository ROOTDIR="`readlink -f $(dirname $0)/../`" # Root directory of the repository
TESTDIR="$ROOTDIR/tests/$PREFIX" TESTDIR="$ROOTDIR/tests/$PREFIX"
...@@ -52,9 +57,6 @@ LOG="$RESDIR/$TEST.testrun" # Base name for log files ...@@ -52,9 +57,6 @@ LOG="$RESDIR/$TEST.testrun" # Base name for log files
OUT="$RESDIR/gen_$TEST" # Base name for output OUT="$RESDIR/gen_$TEST" # Base name for output
RUNS=1 RUNS=1
# Remove all old logs and executables before running new tests
rm -f $LOG.* $OUT.*
# Error reporting # Error reporting
error() { error() {
echo "Error: $1" 1>&2 echo "Error: $1" 1>&2
...@@ -62,6 +64,16 @@ error() { ...@@ -62,6 +64,16 @@ error() {
exit 1 exit 1
} }
# Clean up log/output files unless the DEBUG flag is set
clean() {
if [ -z "$DEBUG" ]; then
rm -f $LOG.* $OUT.*
fi
}
# Do clean up on exit
trap "clean" EXIT HUP INT QUIT TERM
# Instrument the given test using e-acsl-gcc.sh and compare outputs of the # Instrument the given test using e-acsl-gcc.sh and compare outputs of the
# executables generated from instrumented and non-instrumented sources # executables generated from instrumented and non-instrumented sources
run_test() { run_test() {
...@@ -95,3 +107,4 @@ run_test ...@@ -95,3 +107,4 @@ run_test
if test -n "$GMP"; then if test -n "$GMP"; then
run_test "--gmp" run_test "--gmp"
fi fi
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