Guard m98m99 direct-file staging helper

This commit is contained in:
2026-06-13 08:46:05 +08:00
parent 8ff0fe25d4
commit fba2946a67
3 changed files with 84 additions and 28 deletions

View File

@@ -4669,6 +4669,12 @@
return `${wasmDir}/${filename}`;
}
function assertInterpRegressionFileStaging(name, filename, wasmPath) {
if (wasmPath !== `/work/browser-interp/${name}/${filename}`) {
throw new Error(`browser_interp_${name}_${filename}_staging_manifest: list drift`);
}
}
async function writeInterpRegressionFiles(interp, name, files) {
const sourceDir = `../../vendor/linuxcnc/tests/interp/${name}`;
const wasmDir = `/work/browser-interp/${name}`;
@@ -7856,6 +7862,7 @@
"m98m99/01-basics",
"test.ngc",
);
assertInterpRegressionFileStaging("m98m99/01-basics", "test.ngc", m98m99BasicsPath);
verifyExpectedOutput(
"browser_interp_m98m99_01_basics",
interp.runFile(m98m99BasicsPath),
@@ -7876,6 +7883,7 @@
"m98m99/02-variables",
"test.ngc",
);
assertInterpRegressionFileStaging("m98m99/02-variables", "test.ngc", m98m99VariablesPath);
const m98m99VariablesRun = runWithCapturedPrints(() =>
interp.runFile(m98m99VariablesPath),
);
@@ -7905,14 +7913,11 @@
"m98m99/03-error-M98-no-P-word",
"test.ngc",
);
const m98m99InitialStagedNgcFiles = [
m98m99BasicsPath,
m98m99VariablesPath,
assertInterpRegressionFileStaging(
"m98m99/03-error-M98-no-P-word",
"test.ngc",
m98m99M98NoPWordPath,
].map((path) => path.replace("/work/browser-interp/m98m99/", ""));
if (m98m99InitialStagedNgcFiles.join(",") !== m98m99RegressionFiles.slice(0, 3).join(",")) {
throw new Error("browser_interp_m98m99_initial_staging_manifest: list drift");
}
);
verifyExpectedOutput(
"browser_interp_m98m99_03_error_m98_no_p_word",
interp.runFile(m98m99M98NoPWordPath),
@@ -8420,12 +8425,11 @@
"m98m99/14-o-expression-call",
"test.ngc",
);
const m98m99OExpressionCallStagedNgcFiles = [m98m99OExpressionCallPath].map((path) =>
path.replace("/work/browser-interp/m98m99/", ""),
assertInterpRegressionFileStaging(
"m98m99/14-o-expression-call",
"test.ngc",
m98m99OExpressionCallPath,
);
if (m98m99OExpressionCallStagedNgcFiles.join(",") !== m98m99RegressionFiles.slice(23, 24).join(",")) {
throw new Error("browser_interp_m98m99_final_staging_manifest: list drift");
}
const m98m99OExpressionCallRun = runWithCapturedPrints(() =>
interp.runFile(m98m99OExpressionCallPath),
);