Guard fixture loop staging
This commit is contained in:
67
text7.txt
67
text7.txt
@@ -558,3 +558,70 @@ parameter/tool table runtime state tests 和 blocked runtime promotion。
|
|||||||
```bash
|
```bash
|
||||||
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
|
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
十二、2026-06-13 继续执行记录:fixture loop staging guard
|
||||||
|
|
||||||
|
1. 本批目标。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第七轮,处理 Node/browser 成对覆盖的 fixture loop
|
||||||
|
staging 写入点:
|
||||||
|
|
||||||
|
```text
|
||||||
|
INTERP_ERROR_FIXTURES
|
||||||
|
INTERP_FILE_FIXTURES
|
||||||
|
INTERP_BROWSER_FILE_FIXTURES
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 已完成改动。
|
||||||
|
|
||||||
|
- Node 侧新增 `writeLocalErrorGcodeFixture(...)`;
|
||||||
|
- browser 侧新增 `writeLocalErrorGcodeFixture(...)`;
|
||||||
|
- `INTERP_ERROR_FIXTURES` 的 file-error loop 两侧均改为 helper 写入;
|
||||||
|
- `INTERP_FILE_FIXTURES` / `INTERP_BROWSER_FILE_FIXTURES` 的 file loop 两侧均改为
|
||||||
|
`writeLocalGcodeFixture(...)` 写入;
|
||||||
|
- helper 显式检查 staged `wasmPath` 与期望路径一致;
|
||||||
|
- browser 侧仍不枚举目录;
|
||||||
|
- 未修改 G-code 内容、canon expected、error expected 或 interpreter 语义。
|
||||||
|
|
||||||
|
涉及文件:
|
||||||
|
|
||||||
|
```text
|
||||||
|
wasm-port/tests/wasm/node/verify_interp_wasm.mjs
|
||||||
|
wasm-port/tests/browser/interp_smoke.html
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 已完成的目标验证。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh
|
||||||
|
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_interp_browser.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 本批剩余建议验证。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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_sim_configs_inventory_wasm.sh
|
||||||
|
wasm-port/tests/host/verify_host_smokes.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
如果通过,提交建议:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Guard fixture loop staging
|
||||||
|
```
|
||||||
|
|
||||||
|
5. 下一步工作建议。
|
||||||
|
|
||||||
|
继续 staged path guard inventory 第八轮,优先处理 `namedparam_semantics` /
|
||||||
|
`namedparam_ini_semantics` 等 INI-context 单文件 direct `/work/...` 写入点,或
|
||||||
|
`ini_tool_table` 固定三文件 staging manifest;继续避开 parameter/tool table runtime
|
||||||
|
state tests 和 blocked runtime promotion。
|
||||||
|
|
||||||
|
下一轮第一条命令仍保持:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git status --short && git log -5 --oneline && tail -n 120 text7.txt && awk '/^[一二三四五六七八九十百]+、/ {print}' text7.txt | sort | uniq -d
|
||||||
|
```
|
||||||
|
|||||||
@@ -4336,6 +4336,14 @@
|
|||||||
return wasmPath;
|
return wasmPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function writeLocalErrorGcodeFixture(interp, fixtureName, wasmPath, expectedWasmPath) {
|
||||||
|
if (wasmPath !== expectedWasmPath) {
|
||||||
|
throw new Error(`browser_${fixtureName}_local_error_gcode_staging: path drift`);
|
||||||
|
}
|
||||||
|
interp.writeTextFile(wasmPath, await fetchText(`../fixtures/gcode_errors/${fixtureName}.ngc`));
|
||||||
|
return wasmPath;
|
||||||
|
}
|
||||||
|
|
||||||
async function loadSimMachineFiles(machineRel, iniFile, programFile = null) {
|
async function loadSimMachineFiles(machineRel, iniFile, programFile = null) {
|
||||||
const iniText = await fetchText(
|
const iniText = await fetchText(
|
||||||
`../../vendor/linuxcnc/configs/sim/${machineRel}/${iniFile}`,
|
`../../vendor/linuxcnc/configs/sim/${machineRel}/${iniFile}`,
|
||||||
@@ -5215,10 +5223,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const errorFixtureName of INTERP_ERROR_FIXTURES) {
|
for (const errorFixtureName of INTERP_ERROR_FIXTURES) {
|
||||||
const programPath = `/work/${errorFixtureName}-error.ngc`;
|
const programPath = await writeLocalErrorGcodeFixture(
|
||||||
interp.writeTextFile(
|
interp,
|
||||||
programPath,
|
errorFixtureName,
|
||||||
await fetchText(`../fixtures/gcode_errors/${errorFixtureName}.ngc`),
|
`/work/${errorFixtureName}-error.ngc`,
|
||||||
|
`/work/${errorFixtureName}-error.ngc`,
|
||||||
);
|
);
|
||||||
verifyExpectedFileError(
|
verifyExpectedFileError(
|
||||||
`${errorFixtureName}_file`,
|
`${errorFixtureName}_file`,
|
||||||
@@ -5308,8 +5317,12 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const fileFixtureName of INTERP_BROWSER_FILE_FIXTURES) {
|
for (const fileFixtureName of INTERP_BROWSER_FILE_FIXTURES) {
|
||||||
const programPath = `/work/${fileFixtureName}.ngc`;
|
const programPath = await writeLocalGcodeFixture(
|
||||||
interp.writeTextFile(programPath, await fetchText(`../fixtures/gcode/${fileFixtureName}.ngc`));
|
interp,
|
||||||
|
fileFixtureName,
|
||||||
|
`/work/${fileFixtureName}.ngc`,
|
||||||
|
`/work/${fileFixtureName}.ngc`,
|
||||||
|
);
|
||||||
verifyExpectedOutput(
|
verifyExpectedOutput(
|
||||||
`${fileFixtureName}_file`,
|
`${fileFixtureName}_file`,
|
||||||
interp.runFile(programPath),
|
interp.runFile(programPath),
|
||||||
|
|||||||
@@ -124,6 +124,15 @@ function writeLocalGcodeFixture(fixtureName, wasmPath, expectedWasmPath, targetI
|
|||||||
return wasmPath;
|
return wasmPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function writeLocalErrorGcodeFixture(fixtureName, wasmPath, expectedWasmPath, targetInterp = interp) {
|
||||||
|
assert.equal(wasmPath, expectedWasmPath, `${fixtureName} local error gcode staging path drift`);
|
||||||
|
targetInterp.writeTextFile(
|
||||||
|
wasmPath,
|
||||||
|
readFileSync(resolve(rootDir, `tests/fixtures/gcode_errors/${fixtureName}.ngc`), "utf8"),
|
||||||
|
);
|
||||||
|
return wasmPath;
|
||||||
|
}
|
||||||
|
|
||||||
function stageInterpIniContext(name, programFile = "test.ngc") {
|
function stageInterpIniContext(name, programFile = "test.ngc") {
|
||||||
const sourceRootRel = `tests/interp/${name}`;
|
const sourceRootRel = `tests/interp/${name}`;
|
||||||
const iniText = readFileSync(
|
const iniText = readFileSync(
|
||||||
@@ -684,32 +693,30 @@ for (const fixtureName of INTERP_ERROR_FIXTURES) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const fixtureName of INTERP_ERROR_FIXTURES) {
|
for (const fixtureName of INTERP_ERROR_FIXTURES) {
|
||||||
const programPath = `/work/${fixtureName}-error.ngc`;
|
const programPath = writeLocalErrorGcodeFixture(
|
||||||
const programText = readFileSync(
|
fixtureName,
|
||||||
resolve(rootDir, `tests/fixtures/gcode_errors/${fixtureName}.ngc`),
|
`/work/${fixtureName}-error.ngc`,
|
||||||
"utf8",
|
`/work/${fixtureName}-error.ngc`,
|
||||||
);
|
);
|
||||||
const expectedOutput = readFileSync(
|
const expectedOutput = readFileSync(
|
||||||
resolve(rootDir, `tests/fixtures/canon_errors/${fixtureName}.expected`),
|
resolve(rootDir, `tests/fixtures/canon_errors/${fixtureName}.expected`),
|
||||||
"utf8",
|
"utf8",
|
||||||
).trimEnd();
|
).trimEnd();
|
||||||
|
|
||||||
interp.writeTextFile(programPath, programText);
|
|
||||||
verifyExpectedFileError(fixtureName, interp.runFile(programPath), expectedOutput);
|
verifyExpectedFileError(fixtureName, interp.runFile(programPath), expectedOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const fixtureName of INTERP_FILE_FIXTURES) {
|
for (const fixtureName of INTERP_FILE_FIXTURES) {
|
||||||
const programPath = `/work/${fixtureName}.ngc`;
|
const programPath = writeLocalGcodeFixture(
|
||||||
const programText = readFileSync(
|
fixtureName,
|
||||||
resolve(rootDir, `tests/fixtures/gcode/${fixtureName}.ngc`),
|
`/work/${fixtureName}.ngc`,
|
||||||
"utf8",
|
`/work/${fixtureName}.ngc`,
|
||||||
);
|
);
|
||||||
const expectedEvents = readFileSync(
|
const expectedEvents = readFileSync(
|
||||||
resolve(rootDir, `tests/fixtures/canon/${fixtureName}.events`),
|
resolve(rootDir, `tests/fixtures/canon/${fixtureName}.events`),
|
||||||
"utf8",
|
"utf8",
|
||||||
).trimEnd();
|
).trimEnd();
|
||||||
|
|
||||||
interp.writeTextFile(programPath, programText);
|
|
||||||
verifyExpectedOutput(fixtureName, interp.runFile(programPath), expectedEvents);
|
verifyExpectedOutput(fixtureName, interp.runFile(programPath), expectedEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user