From 0300ee4214138baa219a24b70280cc29d7839b1c Mon Sep 17 00:00:00 2001 From: Stefan Eirich <108617852+telemux@users.noreply.github.com> Date: Wed, 12 Jul 2023 16:38:07 +0200 Subject: [PATCH] Update test.sh Print error message in report, when test fails due to runtime error. --- cram_common/cram_tests/scripts/test.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cram_common/cram_tests/scripts/test.sh b/cram_common/cram_tests/scripts/test.sh index 4b6249d2b0..b115ad0e01 100755 --- a/cram_common/cram_tests/scripts/test.sh +++ b/cram_common/cram_tests/scripts/test.sh @@ -48,18 +48,23 @@ EOF # create lisp script and run tests for every system under test for system in "${systems_under_test[@]}"; do echo "-------- System $system under test --------" + create_test_script $system $report_file let starttime=$(date +%s) # if the tests get stuck, e.g. on a memory fault, terminate them after 3 minutes to continue timeout 3m /usr/bin/sbcl --dynamic-space-size 8192 --noinform --disable-debugger --load $tmp_test_script --quit - if [ $? -eq 124 ] + error_code=$(echo $?) + + if [ $error_code -eq 124 ] then - echo "Tests for system $system timed out after 3 minutes. Terminating." + echo "Tests for system $system timed out after 3 minutes. Terminating." >> $report_file + elif [ $error_code -eq 1 ] + then + echo "Tests for system $system exits with error." >> $report_file else - echo "Finished in $(expr $(date +%s) - $starttime) seconds." + echo "Finished successfully in $(expr $(date +%s) - $starttime) seconds." fi done # print the test report cat $report_file -