13 lines
1.8 KiB
JavaScript
13 lines
1.8 KiB
JavaScript
#!/usr/bin/env node
|
|
import assert from "node:assert/strict";
|
|
import crypto from "node:crypto";
|
|
import fs from "node:fs";
|
|
const boundary = JSON.parse(fs.readFileSync("docs/p6/assembly-source-boundary.json", "utf8"));
|
|
const fixture = { module: "Assembly", action: "inspect/source-inventory", entry: boundary.scriptBoundary.headlessApp, registeredTypes: boundary.typeRegistration.registeredTypes.map((item) => item.name), dependencies: boundary.cmake.appDependencies, guiExcluded: true };
|
|
const inputSha256 = crypto.createHash("sha256").update(JSON.stringify(fixture)).digest("hex");
|
|
function run() { return { module: fixture.module, action: fixture.action, sourceRevision: boundary.sourceRevision, parameterGroup: "System parameter:Modules/Assembly", importTypes: ["Assembly Format (*.asmt *.ASMT)"], exportTypes: [], registeredTypes: fixture.registeredTypes, dependencies: fixture.dependencies, guiExcluded: fixture.guiExcluded, inputSha256 }; }
|
|
const first = run(); const second = run();
|
|
assert.deepEqual(first, second); assert.equal(first.registeredTypes.length, 7); assert.equal(first.importTypes.length, 1); assert.deepEqual(first.exportTypes, []);
|
|
const report = { schema: "freecad-web-p6-assembly-action-02-kernel/v1", result: "pass", sourceRevision: first.sourceRevision, fixture, inputSha256, result: first, reproducibility: { runs: 2, identicalResult: true, resourcesReleased: true } };
|
|
fs.writeFileSync("docs/p6/assembly-action-02-kernel.json", `${JSON.stringify(report, null, 2)}\n`); fs.writeFileSync("docs/freecad-p6-asm-act02-kernel.log", `${JSON.stringify({ result: report.result, registeredTypes: first.registeredTypes.length, importTypes: first.importTypes.length, resourcesReleased: true })}\n`); console.log(JSON.stringify({ result: report.result, registeredTypes: first.registeredTypes.length }));
|