Skip to content

Commit

Permalink
Fix failing tests with openscad >=2024.1.26 linked against lib3mf v2 (#6
Browse files Browse the repository at this point in the history
)

* [test] Enable experimental feature "predictible-output" when testing
  • Loading branch information
jschobben authored Apr 9, 2024
1 parent 69e3810 commit c5534a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ function fail_tips {
rm intersect.*
)
fi
if ! openscad --help 2>&1 | grep -q -- '--input'; then
# On newer builds, 'predictible-output' must be enabled to get the same behavior as older ones
echo "For OpenSCAD >= 2024.01.26, only a build with experimental features enabled will work."
fi
}
trap 'echo "Failure at $0:$LINENO" >&2; fail_tips >&2' ERR

Expand Down Expand Up @@ -128,7 +132,12 @@ function test_render {
# Generate output
local OUTPUT="${TEMPDIR}/output.${FORMAT}"
rm -f "$OUTPUT"
# OpenSCAD >= 2024.01.26 with lib3mf v2 requires enabling "predictible-output" to get the same behavior as older versions
if openscad --help 2>&1 | grep -q predictible-output; then
function openscad { command openscad --enable=predictible-output "$@"; }; export -f openscad
fi
${COLORSCAD} -i "$INPUT" -o "$OUTPUT" -j 4 > >(sed 's/^/ /') 2>&1
unset openscad

# Canonicalize the expectation and output, so they can be compared
rm -Rf "${TEMPDIR}/exp" "${TEMPDIR}/out"
Expand Down

0 comments on commit c5534a4

Please sign in to comment.