mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
34 lines
783 B
Bash
Executable file
34 lines
783 B
Bash
Executable file
#!/bin/bash
|
|
|
|
if [ "$(uname -s)" != "Darwin" ]; then
|
|
OPENSCAD=openscad
|
|
else
|
|
OPENSCAD=/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
|
|
fi
|
|
|
|
if [ "$*" != "" ] ; then
|
|
INFILES="$*"
|
|
else
|
|
INFILES="tests/test_*.scad"
|
|
fi
|
|
|
|
OUTCODE=0
|
|
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
|
|
res=$(cat out.echo)
|
|
if [ "$res" = "" ] ; then
|
|
echo "$repname: PASS"
|
|
else
|
|
echo "$repname: FAIL!"
|
|
cat out.echo
|
|
echo
|
|
OUTCODE=-1
|
|
fi
|
|
rm -f out.echo
|
|
fi
|
|
done
|
|
exit $OUTCODE
|
|
|