Files
FreeCADWasmDev/tools/run_p6_points_kernel.mjs
wangdequan 9a7c4f0335 Save FreeCAD Web workspace sources and user validation evidence
IFC native binding remains incomplete; preserve accurate test results.
2026-09-15 22:01:58 +08:00

4 lines
1.8 KiB
JavaScript

#!/usr/bin/env node
import crypto from "node:crypto"; import fs from "node:fs"; import path from "node:path"; import {execFileSync} from "node:child_process"; import {fileURLToPath} from "node:url";
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),"..");const sourceRoot=path.join(root,"freecad-source");const build=path.resolve(process.argv[2]??path.join(sourceRoot,"build-web/configure/bin"));const smoke=path.join(sourceRoot,"src/WebAssembly/FreeCADCoreProbe/points-kernel-smoke.js");const result=JSON.parse(execFileSync(process.execPath,[smoke,build],{cwd:sourceRoot,encoding:"utf8"}).trim().split(/\r?\n/).filter(Boolean).at(-1));const fixture={type:"Points::Feature",points:[[0,0,0],[1,2,3],[-1,4,2]]};const boundary=JSON.parse(fs.readFileSync(path.join(root,"docs/p6/points-source-boundary.json"),"utf8"));const report={schema:"freecad-web-points-kernel/v1",task_id:"FW-P6-PTS-C",status:"pass",source_revision:boundary.source_revision,input_sha256:crypto.createHash("sha256").update(JSON.stringify(fixture)).digest("hex"),fixture,result,result_sha256:crypto.createHash("sha256").update(JSON.stringify(result)).digest("hex"),commands:["node tools/run_p6_points_kernel.mjs freecad-source/build-web/configure/bin"],artifacts:{runtime:"docs/p6/points-runtime.json"},boundaries:["Real Points::Feature and PointKernel store three points and compute the native bounding box; GUI view providers are excluded.","OBJ/PLY import/export and persistence remain later contracts."]};const docs=path.join(root,"docs/p6");fs.writeFileSync(path.join(docs,"points-kernel.json"),`${JSON.stringify(report,null,2)}\n`);fs.writeFileSync(path.join(root,"docs/freecad-p6-points-c-kernel.log"),`${JSON.stringify({status:report.status,count:result.count,min:result.min,max:result.max})}\n`);console.log(JSON.stringify({status:report.status,count:result.count,min:result.min,max:result.max}));