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).
This commit is contained in:
Hans Loeblich 2020-12-16 15:46:23 -06:00 committed by GitHub
parent 03823f990c
commit d287dfe9f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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!"