From d287dfe9f1afe4ed7b5cdb212e117be97c80403a Mon Sep 17 00:00:00 2001 From: Hans Loeblich Date: Wed, 16 Dec 2020 15:46:23 -0600 Subject: [PATCH] Check openscad return code in run_tests.sh I found that even though my openscad was crashing on tests_hull.scad, this script reported that it had passed. This change saves the exit code of the openscad command, and checks that it is 0 (success). --- scripts/run_tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index f2adbe9..5fc0099 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -18,8 +18,9 @@ for testscript in $INFILES ; do testfile="tests/test_$repname" if [ -f "$testfile" ] ; then ${OPENSCAD} -o out.echo --hardwarnings --check-parameters true --check-parameter-ranges true $testfile 2>&1 + retcode=$? res=$(cat out.echo) - if [ "$res" = "" ] ; then + if [ $retcode -eq 0 ] && [ "$res" = "" ] ; then echo "$repname: PASS" else echo "$repname: FAIL!"