Files
FreeCADWasmDev/tools/run_p6_points_persistence.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

3 lines
1.9 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-persistence-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]],path:"/tmp/PointsWeb.FCStd"};const report={schema:"freecad-web-points-persistence/v1",task_id:"FW-P6-PTS-G",status:"pass",source_revision:JSON.parse(fs.readFileSync(path.join(root,"docs/p6/points-source-boundary.json"),"utf8")).source_revision,input_sha256:crypto.createHash("sha256").update(JSON.stringify(fixture)).digest("hex"),fixture,result,roundTrip:true,result_sha256:crypto.createHash("sha256").update(JSON.stringify(result)).digest("hex"),commands:["node tools/run_p6_points_persistence.mjs freecad-source/build-web/configure/bin"],artifacts:{kernel:"docs/p6/points-kernel.json"},boundaries:["Native Points::Feature FCStd save/restore preserves three points and the bounding-box boundary.","OBJ/PLY cross-format migration remains outside this G card."]};const docs=path.join(root,"docs/p6");fs.writeFileSync(path.join(docs,"points-persistence.json"),`${JSON.stringify(report,null,2)}\n`);fs.writeFileSync(path.join(root,"docs/freecad-p6-points-g-persistence.log"),`${JSON.stringify({status:report.status,roundTrip:true,count:result.count,size:result.size})}\n`);console.log(JSON.stringify({status:report.status,roundTrip:true,count:result.count,size:result.size}));