Complete 3axis tutorial native and Web/WASM parity tools
This commit is contained in:
26
scripts/test_axis3_tutorial_preview.py
Normal file
26
scripts/test_axis3_tutorial_preview.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Verify Web preview geometry is produced by the WASM worker."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
PROGRAM = ROOT / "linuxcnc/nc_files/3dtest.ngc"
|
||||
|
||||
|
||||
def main() -> int:
|
||||
result = subprocess.run(["node", "web/worker/test_wasm_preview.mjs"], cwd=ROOT, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=False)
|
||||
if result.returncode != 0:
|
||||
print(result.stderr, end="")
|
||||
return result.returncode
|
||||
report = json.loads(result.stdout.strip().splitlines()[-1])
|
||||
print(json.dumps({"status": "verified", "program": PROGRAM.as_posix(), "preview": report}, ensure_ascii=False))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user