From 38fb69e53510383a3c2718e1c8c349d1e5f852ad Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 8 Jun 2026 12:02:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E8=A7=84=E5=88=92=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:补齐显式工具表 override 路径的浏览器 OPFS 保存读回验证,继续通过 vendored LinuxCNC tooldata_save 路径覆盖。 --- wasm-port/docs/compatibility-validation.md | 4 +-- wasm-port/tests/browser/interp_smoke.html | 34 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 7021d6f..3e8ab9d 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -304,8 +304,8 @@ non-random and random-toolchanger `tooldata_init()` branches, with the SDK only copying text into the Emscripten filesystem and calling the exported C ABI; the browser smoke checks the random-toolchanger `tooldata_save()` C ABI result before OPFS persistence writes the saved table text back, and verifies -that an INI-derived custom tool-table OPFS path can be saved and read back -after the table is loaded through vendored LinuxCNC. The same +that INI-derived custom and explicit host override tool-table OPFS paths can +be saved and read back after the table is loaded through vendored LinuxCNC. The same Node WASM and browser interpreter smokes now validate the exported `Interp::init()`/`Interp::synch()` probe for initialization canonical events, metric/inch `emcStatus` machine-unit conversion, and current/selected tool diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index e079e90..8ded607 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -761,6 +761,40 @@ "5399 101", ].join("\n"), ); + const savedExplicitToolTable = await saveMachineToolTableToOpfs( + interp, + "browser-ini-override-session", + { + opfsPath: loadedIniOverrideSession.toolTable.opfsPath, + wasmPath: loadedIniOverrideSession.toolTable.wasmPath, + }, + ); + if ( + savedExplicitToolTable.opfsPath !== + "linuxcnc/machines/browser-ini-override-session/browser-explicit-tool.tbl" + ) { + throw new Error(`unexpected explicit saved tool path: ${savedExplicitToolTable.opfsPath}`); + } + verifyExpectedOutput( + "opfs_save_explicit_tool_table", + savedExplicitToolTable.result, + [ + "tooldata_save=0", + "tool_1.toolno=9", + "tool_1.pocketno=9", + ].join("\n"), + ); + verifyExpectedOutput( + "opfs_saved_explicit_tool_table_text", + await loadTextFile(loadedIniOverrideSession.toolTable.opfsPath), + [ + "T9", + "P9", + "Z+5.500000", + "D+0.625000", + ";browser explicit tool", + ].join("\n"), + ); await saveMachineTextFiles("browser-invalid-param-file-session", { ini: [