Guard INI context fixture staging
This commit is contained in:
71
text7.txt
71
text7.txt
@@ -625,3 +625,74 @@ 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
|
||||
```
|
||||
|
||||
十三、2026-06-13 继续执行记录:INI context direct fixture staging guard
|
||||
|
||||
1. 本批目标。
|
||||
|
||||
继续 staged path guard inventory 第八轮,处理 Node/browser 成对覆盖的 INI-context
|
||||
direct file 与 fixed manifest staging:
|
||||
|
||||
```text
|
||||
namedparam_semantics.ngc
|
||||
namedparam_ini_semantics.ngc
|
||||
ini_tool_table.ini
|
||||
ini_tool_table.tbl
|
||||
ini_tool_table.ngc
|
||||
```
|
||||
|
||||
2. 已完成改动。
|
||||
|
||||
- `namedparam_semantics.ngc` 两侧均改为 `writeLocalGcodeFixture(...)` 写入;
|
||||
- `namedparam_ini_semantics.ngc` 两侧均改为 `writeLocalGcodeFixture(...)` 写入;
|
||||
- Node 侧新增 `writeIniToolTableFixtureStaging(...)`;
|
||||
- browser 侧新增 `writeIniToolTableFixtureStaging(...)`;
|
||||
- `ini_tool_table` 三文件 staging 增加 fixed manifest、duplicate-free 和 root/path
|
||||
parity guard;
|
||||
- browser 侧仍不枚举目录;
|
||||
- 未修改 INI 内容、G-code 内容、tool table 内容、canon 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 INI context fixture staging
|
||||
```
|
||||
|
||||
5. 下一步工作建议。
|
||||
|
||||
继续 staged path guard inventory 第九轮,优先处理剩余 direct `/work/...` run-step
|
||||
代表路径,例如 `minimal_linear_run_steps` 直接使用 `/work/minimal_linear.ngc` 的调用
|
||||
点,或继续扫描 `verify_interp_wasm.mjs` / `interp_smoke.html` 中未被 helper 覆盖的
|
||||
单文件 staging;继续避开 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
|
||||
```
|
||||
|
||||
@@ -4344,6 +4344,45 @@
|
||||
return wasmPath;
|
||||
}
|
||||
|
||||
async function writeIniToolTableFixtureStaging(interp, wasmDir, expectedWasmDir) {
|
||||
if (wasmDir !== expectedWasmDir) {
|
||||
throw new Error("browser_ini_tool_table_staging_root: path drift");
|
||||
}
|
||||
const files = ["ini_tool_table.ini", "ini_tool_table.tbl", "ini_tool_table.ngc"];
|
||||
if (files.length !== new Set(files).size) {
|
||||
throw new Error("browser_ini_tool_table_staging_manifest: list drift");
|
||||
}
|
||||
for (const file of files) {
|
||||
if (`${wasmDir}/${file}` !== `${expectedWasmDir}/${file}`) {
|
||||
throw new Error(`browser_ini_tool_table_${file}_staging: path drift`);
|
||||
}
|
||||
}
|
||||
|
||||
await writeLocalIniFixture(
|
||||
interp,
|
||||
"ini_tool_table.ini",
|
||||
`${wasmDir}/ini_tool_table.ini`,
|
||||
`${expectedWasmDir}/ini_tool_table.ini`,
|
||||
);
|
||||
await writeLocalIniFixture(
|
||||
interp,
|
||||
"ini_tool_table.tbl",
|
||||
`${wasmDir}/ini_tool_table.tbl`,
|
||||
`${expectedWasmDir}/ini_tool_table.tbl`,
|
||||
);
|
||||
await writeLocalGcodeFixture(
|
||||
interp,
|
||||
"ini_tool_table",
|
||||
`${wasmDir}/ini_tool_table.ngc`,
|
||||
`${expectedWasmDir}/ini_tool_table.ngc`,
|
||||
);
|
||||
|
||||
return {
|
||||
iniPath: `${wasmDir}/ini_tool_table.ini`,
|
||||
programPath: `${wasmDir}/ini_tool_table.ngc`,
|
||||
};
|
||||
}
|
||||
|
||||
async function loadSimMachineFiles(machineRel, iniFile, programFile = null) {
|
||||
const iniText = await fetchText(
|
||||
`../../vendor/linuxcnc/configs/sim/${machineRel}/${iniFile}`,
|
||||
@@ -5342,8 +5381,12 @@
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const namedParamPath = `/work/${INTERP_INI_FIXTURE}.ngc`;
|
||||
interp.writeTextFile(namedParamPath, namedParamProgramText);
|
||||
const namedParamPath = await writeLocalGcodeFixture(
|
||||
interp,
|
||||
INTERP_INI_FIXTURE,
|
||||
`/work/${INTERP_INI_FIXTURE}.ngc`,
|
||||
`/work/${INTERP_INI_FIXTURE}.ngc`,
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
`${INTERP_INI_FIXTURE}_file`,
|
||||
interp.runFileWithIni(namedParamPath, namedParamIniPath),
|
||||
@@ -5351,25 +5394,23 @@
|
||||
);
|
||||
|
||||
const iniToolTableDir = "/work/browser-ini-tool-table";
|
||||
const iniToolTableIniPath = `${iniToolTableDir}/ini_tool_table.ini`;
|
||||
const iniToolTableProgramPath = `${iniToolTableDir}/ini_tool_table.ngc`;
|
||||
interp.writeTextFile(iniToolTableIniPath, await fetchText("../fixtures/ini/ini_tool_table.ini"));
|
||||
interp.writeTextFile(
|
||||
`${iniToolTableDir}/ini_tool_table.tbl`,
|
||||
await fetchText("../fixtures/ini/ini_tool_table.tbl"),
|
||||
);
|
||||
interp.writeTextFile(
|
||||
iniToolTableProgramPath,
|
||||
await fetchText("../fixtures/gcode/ini_tool_table.ngc"),
|
||||
const iniToolTable = await writeIniToolTableFixtureStaging(
|
||||
interp,
|
||||
iniToolTableDir,
|
||||
"/work/browser-ini-tool-table",
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"browser_ini_tool_table_file",
|
||||
interp.runFileWithIni(iniToolTableProgramPath, iniToolTableIniPath),
|
||||
interp.runFileWithIni(iniToolTable.programPath, iniToolTable.iniPath),
|
||||
(await fetchText("../fixtures/canon/ini_tool_table.events")).trimEnd(),
|
||||
);
|
||||
|
||||
const baselineIniPath = `/work/${INTERP_BASELINE_INI_FIXTURE}.ngc`;
|
||||
interp.writeTextFile(baselineIniPath, baselineIniProgramText);
|
||||
const baselineIniPath = await writeLocalGcodeFixture(
|
||||
interp,
|
||||
INTERP_BASELINE_INI_FIXTURE,
|
||||
`/work/${INTERP_BASELINE_INI_FIXTURE}.ngc`,
|
||||
`/work/${INTERP_BASELINE_INI_FIXTURE}.ngc`,
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
`${INTERP_BASELINE_INI_FIXTURE}_file`,
|
||||
interp.runFileWithIni(baselineIniPath, namedParamIniPath),
|
||||
|
||||
@@ -133,6 +133,24 @@ function writeLocalErrorGcodeFixture(fixtureName, wasmPath, expectedWasmPath, ta
|
||||
return wasmPath;
|
||||
}
|
||||
|
||||
function writeIniToolTableFixtureStaging(wasmDir, expectedWasmDir, targetInterp = interp) {
|
||||
assert.equal(wasmDir, expectedWasmDir, "ini_tool_table staging root drift");
|
||||
const files = ["ini_tool_table.ini", "ini_tool_table.tbl", "ini_tool_table.ngc"];
|
||||
assert.equal(new Set(files).size, files.length, "ini_tool_table staging manifest duplicate");
|
||||
for (const file of files) {
|
||||
assert.equal(`${wasmDir}/${file}`, `${expectedWasmDir}/${file}`, `ini_tool_table ${file} staging path drift`);
|
||||
}
|
||||
|
||||
writeLocalIniFixture("ini_tool_table.ini", `${wasmDir}/ini_tool_table.ini`, `${expectedWasmDir}/ini_tool_table.ini`, targetInterp);
|
||||
writeLocalIniFixture("ini_tool_table.tbl", `${wasmDir}/ini_tool_table.tbl`, `${expectedWasmDir}/ini_tool_table.tbl`, targetInterp);
|
||||
writeLocalGcodeFixture("ini_tool_table", `${wasmDir}/ini_tool_table.ngc`, `${expectedWasmDir}/ini_tool_table.ngc`, targetInterp);
|
||||
|
||||
return {
|
||||
iniPath: `${wasmDir}/ini_tool_table.ini`,
|
||||
programPath: `${wasmDir}/ini_tool_table.ngc`,
|
||||
};
|
||||
}
|
||||
|
||||
function stageInterpIniContext(name, programFile = "test.ngc") {
|
||||
const sourceRootRel = `tests/interp/${name}`;
|
||||
const iniText = readFileSync(
|
||||
@@ -732,8 +750,11 @@ verifyExpectedOutput(
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const namedParamFilePath = `/work/${INTERP_INI_FIXTURE}.ngc`;
|
||||
interp.writeTextFile(namedParamFilePath, namedParamProgramText);
|
||||
const namedParamFilePath = writeLocalGcodeFixture(
|
||||
INTERP_INI_FIXTURE,
|
||||
`/work/${INTERP_INI_FIXTURE}.ngc`,
|
||||
`/work/${INTERP_INI_FIXTURE}.ngc`,
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"namedparam_semantics_file",
|
||||
interp.runFileWithIni(namedParamFilePath, namedParamIniPath),
|
||||
@@ -741,28 +762,21 @@ verifyExpectedOutput(
|
||||
);
|
||||
|
||||
const iniToolTableDir = "/work/ini-tool-table";
|
||||
const iniToolTableIniPath = `${iniToolTableDir}/ini_tool_table.ini`;
|
||||
const iniToolTableProgramPath = `${iniToolTableDir}/ini_tool_table.ngc`;
|
||||
interp.writeTextFile(
|
||||
iniToolTableIniPath,
|
||||
readFileSync(resolve(rootDir, "tests/fixtures/ini/ini_tool_table.ini"), "utf8"),
|
||||
);
|
||||
interp.writeTextFile(
|
||||
`${iniToolTableDir}/ini_tool_table.tbl`,
|
||||
readFileSync(resolve(rootDir, "tests/fixtures/ini/ini_tool_table.tbl"), "utf8"),
|
||||
);
|
||||
interp.writeTextFile(
|
||||
iniToolTableProgramPath,
|
||||
readFileSync(resolve(rootDir, "tests/fixtures/gcode/ini_tool_table.ngc"), "utf8"),
|
||||
const iniToolTable = writeIniToolTableFixtureStaging(
|
||||
iniToolTableDir,
|
||||
"/work/ini-tool-table",
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"ini_tool_table_file",
|
||||
interp.runFileWithIni(iniToolTableProgramPath, iniToolTableIniPath),
|
||||
interp.runFileWithIni(iniToolTable.programPath, iniToolTable.iniPath),
|
||||
readFileSync(resolve(rootDir, "tests/fixtures/canon/ini_tool_table.events"), "utf8").trimEnd(),
|
||||
);
|
||||
|
||||
const baselineIniFilePath = `/work/${INTERP_BASELINE_INI_FIXTURE}.ngc`;
|
||||
interp.writeTextFile(baselineIniFilePath, baselineIniProgramText);
|
||||
const baselineIniFilePath = writeLocalGcodeFixture(
|
||||
INTERP_BASELINE_INI_FIXTURE,
|
||||
`/work/${INTERP_BASELINE_INI_FIXTURE}.ngc`,
|
||||
`/work/${INTERP_BASELINE_INI_FIXTURE}.ngc`,
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
`${INTERP_BASELINE_INI_FIXTURE}_file`,
|
||||
interp.runFileWithIni(baselineIniFilePath, namedParamIniPath),
|
||||
|
||||
Reference in New Issue
Block a user