补充 INI WASM 文件名查询覆盖

结论:Node INI WASM smoke 现在通过 LinuxCNC-backed getString 路径验证 PARAMETER_FILE 和 TOOL_TABLE 文件名查询,支撑后续 OPFS 会话桥接输入。
This commit is contained in:
2026-06-08 10:09:14 +08:00
parent bc60575651
commit 83f409c900
2 changed files with 20 additions and 2 deletions

View File

@@ -76,7 +76,9 @@ The WASM INI smoke script builds `runtime/ui/ini-panel/linuxcnc_ini.js` and
`linuxcnc_ini.wasm` from vendored LinuxCNC `inifile.cc`, then loads that `linuxcnc_ini.wasm` from vendored LinuxCNC `inifile.cc`, then loads that
module through `runtime/sdk/src/index.js` in Node and verifies INI string and module through `runtime/sdk/src/index.js` in Node and verifies INI string and
boolean queries against a file written to the Emscripten filesystem. Boolean boolean queries against a file written to the Emscripten filesystem. Boolean
conversion is validated through vendored LinuxCNC `iniFindBool()`. conversion is validated through vendored LinuxCNC `iniFindBool()`, and
machine-session file-name lookup is validated through LinuxCNC string queries
for `[RS274NGC]PARAMETER_FILE` and `[EMCIO]TOOL_TABLE`.
The WASM interpreter-core smoke script builds The WASM interpreter-core smoke script builds
`build/wasm/core/linuxcnc_interp.js` and `linuxcnc_interp.wasm` from the same `build/wasm/core/linuxcnc_interp.js` and `linuxcnc_interp.wasm` from the same
@@ -190,7 +192,7 @@ The validation fails if:
| Harness | Purpose | | Harness | Purpose |
| --- | --- | | --- | --- |
| `tests/wasm/node/verify_ini_wasm.sh` | Validates the browser-facing INI WASM module can be built from vendored LinuxCNC `inifile.cc`, loaded through the JS SDK in Node, and queried through the exported C ABI. | | `tests/wasm/node/verify_ini_wasm.sh` | Validates the browser-facing INI WASM module can be built from vendored LinuxCNC `inifile.cc`, loaded through the JS SDK in Node, and queried through the exported C ABI, including LinuxCNC-backed boolean conversion and machine-session file-name string lookup. |
| `tests/wasm/node/verify_interp_wasm.sh` | Validates the initial interpreter-core WASM module can be built from vendored LinuxCNC interpreter source, loaded through the interpreter JS SDK, run the first fixture group through `Interp::execute()` and selected file fixtures through `Interp::open()`/`read()`/`execute()`, match the native canonical event plus required state readback fixtures, and run parameter-file restore/save through vendored LinuxCNC `Interp::restore_parameters()` and `Interp::save_parameters()`. | | `tests/wasm/node/verify_interp_wasm.sh` | Validates the initial interpreter-core WASM module can be built from vendored LinuxCNC interpreter source, loaded through the interpreter JS SDK, run the first fixture group through `Interp::execute()` and selected file fixtures through `Interp::open()`/`read()`/`execute()`, match the native canonical event plus required state readback fixtures, and run parameter-file restore/save through vendored LinuxCNC `Interp::restore_parameters()` and `Interp::save_parameters()`. |
| `tests/opfs/node/verify_file_service.sh` | Validates the host-owned OPFS text-file adapter, path model, session snapshot store including custom filenames and envelope/path rejection paths, machine file store, G-code text store including filename rejection paths, OPFS-to-WASM parameter/tool-table bridges, and grouped machine-session loading without moving file persistence, parameter semantics, or tool-table semantics into the WASM core. | | `tests/opfs/node/verify_file_service.sh` | Validates the host-owned OPFS text-file adapter, path model, session snapshot store including custom filenames and envelope/path rejection paths, machine file store, G-code text store including filename rejection paths, OPFS-to-WASM parameter/tool-table bridges, and grouped machine-session loading without moving file persistence, parameter semantics, or tool-table semantics into the WASM core. |
| `tests/browser/verify_ini_panel_browser.sh` | Validates the INI SDK, INI/interpreter WASM module loading, OPFS text-file round trip, generic session snapshot round trip plus custom filename and envelope/path rejection paths, machine file text round trip, G-code text round trip plus filename rejection paths, and the INI panel UI's machine-session load with default OPFS parameter/tool-table file mapping, G-code run, and canonical-event display paths in a real browser runtime. | | `tests/browser/verify_ini_panel_browser.sh` | Validates the INI SDK, INI/interpreter WASM module loading, OPFS text-file round trip, generic session snapshot round trip plus custom filename and envelope/path rejection paths, machine file text round trip, G-code text round trip plus filename rejection paths, and the INI panel UI's machine-session load with default OPFS parameter/tool-table file mapping, G-code run, and canonical-event display paths in a real browser runtime. |

View File

@@ -31,9 +31,13 @@ COORDINATES = X Y Z A B
KINEMATICS = xyzbc-trt-kins KINEMATICS = xyzbc-trt-kins
JOINTS = 5 JOINTS = 5
[RS274NGC]
PARAMETER_FILE = node-linuxcnc.var
[EMCIO] [EMCIO]
RANDOM_TOOLCHANGER = ON RANDOM_TOOLCHANGER = ON
NON_RANDOM_TOOLCHANGER = no NON_RANDOM_TOOLCHANGER = no
TOOL_TABLE = node-tool.tbl
`, `,
); );
@@ -46,6 +50,14 @@ assert.equal(
ini.getString("/work/node-smoke.ini", "KINS", "KINEMATICS"), ini.getString("/work/node-smoke.ini", "KINS", "KINEMATICS"),
"xyzbc-trt-kins", "xyzbc-trt-kins",
); );
assert.equal(
ini.getString("/work/node-smoke.ini", "RS274NGC", "PARAMETER_FILE"),
"node-linuxcnc.var",
);
assert.equal(
ini.getString("/work/node-smoke.ini", "EMCIO", "TOOL_TABLE"),
"node-tool.tbl",
);
assert.equal(ini.getString("/work/node-smoke.ini", "TRAJ", "MISSING"), null); assert.equal(ini.getString("/work/node-smoke.ini", "TRAJ", "MISSING"), null);
assert.equal(ini.getBool("/work/node-smoke.ini", "EMCIO", "RANDOM_TOOLCHANGER"), true); assert.equal(ini.getBool("/work/node-smoke.ini", "EMCIO", "RANDOM_TOOLCHANGER"), true);
assert.equal(ini.getBool("/work/node-smoke.ini", "EMCIO", "NON_RANDOM_TOOLCHANGER"), false); assert.equal(ini.getBool("/work/node-smoke.ini", "EMCIO", "NON_RANDOM_TOOLCHANGER"), false);
@@ -54,9 +66,13 @@ assert.equal(ini.getBool("/work/node-smoke.ini", "EMCIO", "MISSING"), null);
assert.deepEqual(ini.getFields("/work/node-smoke.ini", { assert.deepEqual(ini.getFields("/work/node-smoke.ini", {
machine: { section: "EMC", tag: "MACHINE" }, machine: { section: "EMC", tag: "MACHINE" },
joints: { section: "KINS", tag: "JOINTS" }, joints: { section: "KINS", tag: "JOINTS" },
parameterFile: { section: "RS274NGC", tag: "PARAMETER_FILE" },
toolTable: { section: "EMCIO", tag: "TOOL_TABLE" },
}), { }), {
machine: "wasm-node-smoke", machine: "wasm-node-smoke",
joints: "5", joints: "5",
parameterFile: "node-linuxcnc.var",
toolTable: "node-tool.tbl",
}); });
console.log("ini_wasm_node_smoke=ok"); console.log("ini_wasm_node_smoke=ok");