Guard m98m99 direct-file staging helper
This commit is contained in:
@@ -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),
|
||||
);
|
||||
|
||||
@@ -276,6 +276,14 @@ function writeInterpRegressionFile(name, filename) {
|
||||
return `${wasmDir}/${filename}`;
|
||||
}
|
||||
|
||||
function assertInterpRegressionFileStaging(name, filename, wasmPath) {
|
||||
assert.equal(
|
||||
wasmPath,
|
||||
`/work/interp/${name}/${filename}`,
|
||||
`interp ${name}/${filename} staging manifest drift`,
|
||||
);
|
||||
}
|
||||
|
||||
function writeInterpRegressionFiles(name, files) {
|
||||
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name);
|
||||
const wasmDir = `/work/interp/${name}`;
|
||||
@@ -2857,6 +2865,7 @@ assert.deepEqual(
|
||||
);
|
||||
|
||||
const m98m99BasicsPath = writeInterpRegressionFile("m98m99/01-basics", "test.ngc");
|
||||
assertInterpRegressionFileStaging("m98m99/01-basics", "test.ngc", m98m99BasicsPath);
|
||||
verifyExpectedOutput(
|
||||
"interp_m98m99_01_basics_wasm",
|
||||
interp.runFile(m98m99BasicsPath),
|
||||
@@ -2873,6 +2882,7 @@ verifyExpectedOutput(
|
||||
);
|
||||
|
||||
const m98m99VariablesPath = writeInterpRegressionFile("m98m99/02-variables", "test.ngc");
|
||||
assertInterpRegressionFileStaging("m98m99/02-variables", "test.ngc", m98m99VariablesPath);
|
||||
const m98m99VariablesRun = runWithCapturedPrints(() => interp.runFile(m98m99VariablesPath));
|
||||
verifyExpectedOutput(
|
||||
"interp_m98m99_02_variables_wasm",
|
||||
@@ -2899,16 +2909,10 @@ const m98m99M98NoPWordPath = writeInterpRegressionFile(
|
||||
"m98m99/03-error-M98-no-P-word",
|
||||
"test.ngc",
|
||||
);
|
||||
assert.deepEqual(
|
||||
[
|
||||
m98m99BasicsPath,
|
||||
m98m99VariablesPath,
|
||||
m98m99M98NoPWordPath,
|
||||
],
|
||||
m98m99RegressionFiles
|
||||
.slice(0, 3)
|
||||
.map((file) => `/work/interp/m98m99/${file}`),
|
||||
"interp m98m99 initial direct-file staging manifest drift",
|
||||
assertInterpRegressionFileStaging(
|
||||
"m98m99/03-error-M98-no-P-word",
|
||||
"test.ngc",
|
||||
m98m99M98NoPWordPath,
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"interp_m98m99_03_error_m98_no_p_word_wasm",
|
||||
@@ -3397,12 +3401,10 @@ const m98m99OExpressionCallPath = writeInterpRegressionFile(
|
||||
"m98m99/14-o-expression-call",
|
||||
"test.ngc",
|
||||
);
|
||||
assert.deepEqual(
|
||||
[m98m99OExpressionCallPath],
|
||||
m98m99RegressionFiles
|
||||
.slice(23, 24)
|
||||
.map((file) => `/work/interp/m98m99/${file}`),
|
||||
"interp m98m99 final o-expression direct-file staging manifest drift",
|
||||
assertInterpRegressionFileStaging(
|
||||
"m98m99/14-o-expression-call",
|
||||
"test.ngc",
|
||||
m98m99OExpressionCallPath,
|
||||
);
|
||||
const m98m99OExpressionCallRun = runWithCapturedPrints(() =>
|
||||
interp.runFile(m98m99OExpressionCallPath),
|
||||
|
||||
Reference in New Issue
Block a user