From e141b4fc69b0c7a228dd60febe66f70bca22bfb6 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 8 Jun 2026 09:33:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=20OPFS=20=E9=BB=98=E8=AE=A4=E8=B7=AF=E5=BE=84=E8=A6=86?= =?UTF-8?q?=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:浏览器解释器 smoke 现在验证真实 INI WASM 会话在缺失参数文件和刀具表文件名时回落到默认 OPFS 路径。 --- wasm-port/docs/compatibility-validation.md | 6 ++++-- wasm-port/tests/browser/interp_smoke.html | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 73deca8..5b97d7d 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -135,7 +135,8 @@ to reject invalid INI-derived parameter/tool-table file names through the OPFS path model after the names are parsed by the LinuxCNC-backed INI WASM SDK. It also verifies that explicit session parameter/tool-table file-name options override INI-derived names before OPFS text is copied into the LinuxCNC-backed -WASM filesystem. +WASM filesystem, and that absent INI file-name values use the default OPFS +parameter/tool-table paths in a real browser session. The aggregate host smoke script builds the INI and interpreter-core WASM artifacts once, then runs the Node WASM smokes, the Node OPFS mock smoke, and @@ -279,7 +280,8 @@ session snapshot custom filename handling plus envelope/path rejection for unsupported format/version, wrong session id, and invalid snapshot filenames, and a browser interpreter smoke that uses the same session bridge with real LinuxCNC INI WASM parsing before saving OPFS-backed parameter and -tool-table text through vendored LinuxCNC file APIs. +tool-table text through vendored LinuxCNC file APIs, including default OPFS +path fallback when INI file-name values are absent. Full browser coverage, full SDK coverage, and richer machine-state validation remain future work. diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index c32a1cb..7911a9c 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -307,6 +307,18 @@ toolTableWasmPath: "/work/browser-random-tool.tbl", }, ); + if ( + loadedRandomSession.parameters.opfsPath !== + "linuxcnc/machines/browser-random-toolchanger/linuxcnc.var" + ) { + throw new Error(`unexpected default parameter path: ${loadedRandomSession.parameters.opfsPath}`); + } + if ( + loadedRandomSession.toolTable.opfsPath !== + "linuxcnc/machines/browser-random-toolchanger/tool.tbl" + ) { + throw new Error(`unexpected default tool path: ${loadedRandomSession.toolTable.opfsPath}`); + } verifyExpectedOutput( "opfs_load_random_tool_table", loadedRandomSession.toolTable.result,