2019-05-16 04:07:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-20 06:18:04 +00:00
|
|
|
if [ "$(uname -s)" != "Darwin" ]; then
|
|
|
|
OPENSCAD=openscad
|
|
|
|
else
|
|
|
|
OPENSCAD=/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
|
|
|
|
fi
|
2019-05-16 04:07:27 +00:00
|
|
|
|
2020-07-01 00:18:33 +00:00
|
|
|
if [ "$*" != "" ] ; then
|
|
|
|
INFILES="$*"
|
|
|
|
else
|
|
|
|
INFILES="tests/test_*.scad"
|
|
|
|
fi
|
|
|
|
|
2020-06-20 06:25:59 +00:00
|
|
|
OUTCODE=0
|
2020-07-01 00:18:33 +00:00
|
|
|
for testscript in $INFILES ; do
|
|
|
|
repname="$(basename $testscript | sed 's/^test_//')"
|
|
|
|
testfile="tests/test_$repname"
|
|
|
|
if [ -f "$testfile" ] ; then
|
|
|
|
${OPENSCAD} -o out.echo --hardwarnings --check-parameters true --check-parameter-ranges true $testfile 2>&1
|
2020-12-16 21:46:23 +00:00
|
|
|
retcode=$?
|
2020-07-01 00:18:33 +00:00
|
|
|
res=$(cat out.echo)
|
2020-12-16 21:46:23 +00:00
|
|
|
if [ $retcode -eq 0 ] && [ "$res" = "" ] ; then
|
2020-07-01 00:18:33 +00:00
|
|
|
echo "$repname: PASS"
|
|
|
|
else
|
|
|
|
echo "$repname: FAIL!"
|
|
|
|
cat out.echo
|
|
|
|
echo
|
|
|
|
OUTCODE=-1
|
|
|
|
fi
|
|
|
|
rm -f out.echo
|
2019-11-06 01:31:58 +00:00
|
|
|
fi
|
2019-05-16 04:07:27 +00:00
|
|
|
done
|
2020-06-20 06:25:59 +00:00
|
|
|
exit $OUTCODE
|
2019-05-16 04:07:27 +00:00
|
|
|
|