Guard browser generated fixture wasm path helper

This commit is contained in:
2026-06-14 01:26:09 +08:00
parent b41ac3af03
commit 9757d196d1
2 changed files with 49 additions and 7 deletions

View File

@@ -657,3 +657,50 @@ host_wasm_opfs_browser_smokes=ok
继续扫描 `/work/browser-*` staging literal。优先看 direct parameter/tool-table fixture
的 `writeGenerated*Fixture(..., wasmPath, expectedWasmPath, ...)` 双参数重复是否还能
用小 helper 或局部常量收敛;只改 browser test glue不改变 generated file path。
十六、2026-06-14 继续执行记录browser generated fixture wasm path helper guard
本轮按上一条下一步建议继续扫描 direct parameter/tool-table fixture 重复形态,范围仍只触及
`wasm-port/tests/browser/interp_smoke.html` 的 browser/OPFS test glue。
完成内容:
- 将 `writeGeneratedParameterFixture(...)`、`writeGeneratedToolTableFixture(...)`
的 `expectedWasmPath` 参数设为可选,默认等于 `wasmPath`
- 收敛 5 个 direct fixture 调用点上的重复 `wasmPath` / `expectedWasmPath`
双参数传递;
- 路径 drift guard 仍保留,直接写入的 fixture 内容未改;
- 未改变 generated file path、OPFS bridge behavior、file-service、path-model、
SDK planner、interpreter、INI、tool、parameter 或 LinuxCNC-owned runtime semantics。
验证已通过:
```bash
git diff --check
wasm-port/tools/verify_vendor_sync.sh
wasm-port/tools/verify_no_standalone_cnc_semantics.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.sh
wasm-port/tests/host/verify_host_smokes.sh
```
关键输出:
```text
vendor sync up to date
standalone CNC semantics guard complete
interp_wasm_node_smoke=ok
sim_configs_wasm_node_inventory_executed=28
sim_configs_wasm_node_inventory_passed=28
sim_configs_wasm_node_inventory_skipped=131
sim_configs_wasm_node_inventory_unexpected_fail=0
browser_interp_smoke=ok
host_wasm_opfs_browser_smokes=ok
```
下一步建议:
继续保持小批量 browser staging path literal guard。优先扫描 `/work/browser-*`
的 direct session WASM path 常量,看是否还能把 `browserInterp*` 与 `browserRandom*`
分组的重复前缀抽成局部 helper只改 browser test glue不改变 staging model。

View File

@@ -4453,7 +4453,7 @@
return wasmPath;
}
function writeGeneratedParameterFixture(interp, wasmPath, expectedWasmPath, text) {
function writeGeneratedParameterFixture(interp, wasmPath, text, expectedWasmPath = wasmPath) {
const checkedPath = generatedParameterPath(wasmPath, expectedWasmPath);
interp.writeTextFile(checkedPath, text);
return checkedPath;
@@ -4502,7 +4502,7 @@
return wasmPath;
}
function writeGeneratedToolTableFixture(interp, wasmPath, expectedWasmPath, text) {
function writeGeneratedToolTableFixture(interp, wasmPath, text, expectedWasmPath = wasmPath) {
const checkedPath = generatedToolTablePath(wasmPath, expectedWasmPath);
interp.writeTextFile(checkedPath, text);
return checkedPath;
@@ -8973,7 +8973,6 @@
const outOfOrderParameterFilePath = writeGeneratedParameterFixture(
interp,
"/work/browser-out-of-order.var",
"/work/browser-out-of-order.var",
"5220 1\n5161 2\n",
);
verifyExpectedOutput(
@@ -8988,7 +8987,6 @@
const missingRequiredParameterFilePath = writeGeneratedParameterFixture(
interp,
"/work/browser-missing-required.var",
"/work/browser-missing-required.var",
"5161 3.5\n5220 1\n",
);
verifyExpectedOutput(
@@ -9004,7 +9002,6 @@
const browserParameterFilePath = writeGeneratedParameterFixture(
interp,
"/work/browser-direct.var",
"/work/browser-direct.var",
[
"5161 10.5",
"5162 20.25",
@@ -9069,7 +9066,6 @@
const browserToolTablePath = writeGeneratedToolTableFixture(
interp,
"/work/browser-direct-tool.tbl",
"/work/browser-direct-tool.tbl",
[
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser direct finish tool",
"T5 P9 X1 Y2 Z3 ;browser direct rough tool",
@@ -9126,7 +9122,6 @@
const browserRandomToolTablePath = writeGeneratedToolTableFixture(
interp,
"/work/browser-direct-random-tool.tbl",
"/work/browser-direct-random-tool.tbl",
[
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser direct random finish tool",
"T5 P9 X1 Y2 Z3 ;browser direct random rough tool",