mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-04 14:20:58 +00:00
Check the Project Refresh Test's Result Directly
Shellcheck SC2181: test the checker's exit status in the if instead of reading $? afterwards.
This commit is contained in:
@@ -87,7 +87,7 @@ with open(dst + ".expected.json", "w") as f:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
"$PY" - "$WORK/$1/out.3mf" "$WORK/old.3mf.expected.json" "$1" <<'EOF'
|
if ! "$PY" - "$WORK/$1/out.3mf" "$WORK/old.3mf.expected.json" "$1" <<'EOF'
|
||||||
import json, sys, zipfile
|
import json, sys, zipfile
|
||||||
|
|
||||||
with zipfile.ZipFile(sys.argv[1]) as z:
|
with zipfile.ZipFile(sys.argv[1]) as z:
|
||||||
@@ -99,7 +99,10 @@ for e in errors:
|
|||||||
print("FAIL: " + e)
|
print("FAIL: " + e)
|
||||||
sys.exit(1 if errors else 0)
|
sys.exit(1 if errors else 0)
|
||||||
EOF
|
EOF
|
||||||
[ $? -eq 0 ] || { tail -n 40 "$WORK/$1/log"; exit 1; }
|
then
|
||||||
|
tail -n 40 "$WORK/$1/log"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
slice project "$WORK/old.3mf"
|
slice project "$WORK/old.3mf"
|
||||||
|
|||||||
Reference in New Issue
Block a user