Files
FreeCADWasmDev/src/WebAssembly/FreeCADCoreProbe/points-persistence-smoke.js
wangdequan 0a2e7ce7f5
Some checks failed
FreeCAD master CI / Prepare (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
FreeCAD master CI / Pixi (push) Has been cancelled
FreeCAD master CI / Ubuntu (push) Has been cancelled
FreeCAD master CI / Windows (push) Has been cancelled
FreeCAD master CI / Lint (push) Has been cancelled
FreeCAD master CI / WrapUp (push) Has been cancelled
Stale Issues / stale (push) Has been cancelled
Push Crowdin Translations / update-crowdin (push) Has been cancelled
Fetch Crowdin Translations / update-crowdin (push) Has been cancelled
Add FreeCAD WebAssembly runtime probes
2026-08-23 17:48:10 +08:00

2 lines
1.1 KiB
JavaScript

const fs=require("fs"),path=require("path"),{pathToFileURL}=require("url");const build=path.resolve(process.argv[2]||"build-web/configure/bin");async function main(){globalThis.__dirname=`${build}${path.sep}`;globalThis.require=require;const m=await import(pathToFileURL(path.join(build,"FreeCADWebPointsRuntimeProbe.js")));const p=await m.default({wasmBinary:fs.readFileSync(path.join(build,"FreeCADWebPointsRuntimeProbe.wasm"))});const c=(n,t="number")=>p.ccall(n,t);const r={run:c("fc_web_points_save_reopen"),error:c("fc_web_points_persistence_error","string"),path:c("fc_web_points_persistence_path","string"),type:c("fc_web_points_persistence_type","string"),count:c("fc_web_points_persistence_count"),size:c("fc_web_points_persistence_size"),beforeMinX:c("fc_web_points_persistence_before_min_x"),afterMinX:c("fc_web_points_persistence_after_min_x")};if(r.run!==1||r.error!==""||r.type!=="Points::Feature"||r.count!==3||r.size<=0||r.beforeMinX!==r.afterMinX)throw Error(JSON.stringify(r));console.log(JSON.stringify(r));}main().catch(e=>{console.error(e);process.exitCode=1});