From 441231cf5ebae221631f57a5288ec574acb9b2ed Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 8 Jun 2026 11:41:41 +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 结论:补齐 INI 派生自定义工具表路径的浏览器 OPFS 保存读回验证,继续通过 vendored LinuxCNC tooldata_save 路径覆盖。 --- wasm-port/docs/compatibility-validation.md | 4 +++- wasm-port/tests/browser/interp_smoke.html | 28 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 0b4b61d..fc8a922 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -301,7 +301,9 @@ load/save behavior through vendored `tooldata_common.cc`, including the 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. The same +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 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 d074792..f4ced92 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -599,6 +599,34 @@ "tool_1.comment=browser custom tool", ].join("\n"), ); + const savedIniNamedToolTable = await saveMachineToolTableToOpfs( + interp, + "browser-ini-file-session", + { + opfsPath: loadedIniFileSession.toolTable.opfsPath, + wasmPath: loadedIniFileSession.toolTable.wasmPath, + }, + ); + verifyExpectedOutput( + "opfs_save_ini_named_tool_table", + savedIniNamedToolTable.result, + [ + "tooldata_save=0", + "tool_1.toolno=8", + "tool_1.pocketno=8", + ].join("\n"), + ); + verifyExpectedOutput( + "opfs_saved_ini_named_tool_table_text", + await loadTextFile(loadedIniFileSession.toolTable.opfsPath), + [ + "T8", + "P8", + "Z+4.500000", + "D+0.500000", + ";browser custom tool", + ].join("\n"), + ); await saveMachineTextFiles("browser-ini-override-session", { ini: [