mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 08:19:43 +00:00
31 lines
790 B
Bash
Executable file
31 lines
790 B
Bash
Executable file
#!/bin/bash
|
|
|
|
OPENSCAD=openscad
|
|
if [ "$(uname -s)" == "Darwin" ]; then
|
|
OPENSCAD=/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
|
|
fi
|
|
|
|
INFILES=("$@")
|
|
if (( ${#INFILES[@]} == 0 )); then
|
|
INFILES=(tests/test_*.scad)
|
|
fi
|
|
|
|
OUTCODE=0
|
|
for testfile in "${INFILES[@]}"; do
|
|
if [[ -f "$testfile" ]] ; then
|
|
repname="$(basename "$testfile" | sed 's/^test_//')"
|
|
"${OPENSCAD}" -o out.echo --hardwarnings --check-parameters true --check-parameter-ranges true "$testfile" 2>&1
|
|
retcode=$?
|
|
output=$(cat out.echo)
|
|
if (( retcode == 0 )) && [[ "$output" = "" ]]; then
|
|
echo "$repname: PASS"
|
|
else
|
|
echo "$repname: FAIL!"
|
|
echo "$output"
|
|
OUTCODE=1
|
|
fi
|
|
rm -f out.echo
|
|
fi
|
|
done
|
|
exit "$OUTCODE"
|
|
|