Expand LinuxCNC interpreter regression coverage

This commit is contained in:
2026-06-09 14:54:54 +08:00
parent 50757e45ba
commit 5bd8f12872
143 changed files with 10895 additions and 219 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,7 @@ import assert from "node:assert/strict";
import {
createLinuxCncInterpSdk,
planIniFileContextStaging,
planSimConfigStaging,
} from "../../../runtime/sdk/src/index.js";
@@ -79,6 +80,59 @@ assert.deepEqual(
],
"synthetic sim-config staging plan",
);
assert.deepEqual(
syntheticPlan.files.map((file) => [file.sourceRel, file.wasmPath]).sort(),
[
["configs/sim/example/M123", "/work/sim/example/M123"],
["configs/sim/example/linuxcnc.var", "/work/sim/example/linuxcnc.var"],
["configs/sim/example/subs/helper.ngc", "/work/sim/example/subs/helper.ngc"],
["configs/sim/example/test.ini", "/work/sim/example/test.ini"],
["configs/sim/example/test.ngc", "/work/sim/example/test.ngc"],
["configs/sim/example/tool.tbl", "/work/sim/example/tool.tbl"],
],
"synthetic sim-config staging wasm paths",
);
const genericPlan = planIniFileContextStaging({
manifestText: [
"tests/interp/example/test.ini",
"tests/interp/example/test.ngc",
"tests/interp/example/test.tbl",
"tests/interp/example/startup.var",
"tests/interp/example/subs/helper.ngc",
"tests/interp/example/subs/rm145.ngc",
"tests/interp/example/more-subs/other.ngc",
"tests/interp/example/M145",
].join("\n"),
sourceRootRel: "tests/interp/example",
iniFile: "test.ini",
iniText: [
"[DISPLAY]",
"OPEN_FILE = test.ngc",
"[RS274NGC]",
"PARAMETER_FILE = startup.var",
"SUBROUTINE_PATH = subs:more-subs",
"USER_M_PATH = .",
"REMAP = M145 modalgroup=10 ngc=rm145",
"[EMCIO]",
"TOOL_TABLE = test.tbl",
].join("\n"),
wasmDir: "/work/interp/example",
});
assert.deepEqual(
genericPlan.files.map((file) => [file.sourceRel, file.wasmPath, file.executable]).sort(),
[
["tests/interp/example/M145", "/work/interp/example/M145", true],
["tests/interp/example/more-subs/other.ngc", "/work/interp/example/more-subs/other.ngc", false],
["tests/interp/example/startup.var", "/work/interp/example/startup.var", false],
["tests/interp/example/subs/helper.ngc", "/work/interp/example/subs/helper.ngc", false],
["tests/interp/example/subs/rm145.ngc", "/work/interp/example/subs/rm145.ngc", false],
["tests/interp/example/test.ini", "/work/interp/example/test.ini", false],
["tests/interp/example/test.ngc", "/work/interp/example/test.ngc", false],
["tests/interp/example/test.tbl", "/work/interp/example/test.tbl", false],
],
"generic INI file-context staging plan",
);
function simMachine(machineRel, iniFile, programFile = null) {
const iniText = readFileSync(