Guard fixture loop staging
This commit is contained in:
@@ -4336,6 +4336,14 @@
|
||||
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) {
|
||||
const iniText = await fetchText(
|
||||
`../../vendor/linuxcnc/configs/sim/${machineRel}/${iniFile}`,
|
||||
@@ -5215,10 +5223,11 @@
|
||||
}
|
||||
|
||||
for (const errorFixtureName of INTERP_ERROR_FIXTURES) {
|
||||
const programPath = `/work/${errorFixtureName}-error.ngc`;
|
||||
interp.writeTextFile(
|
||||
programPath,
|
||||
await fetchText(`../fixtures/gcode_errors/${errorFixtureName}.ngc`),
|
||||
const programPath = await writeLocalErrorGcodeFixture(
|
||||
interp,
|
||||
errorFixtureName,
|
||||
`/work/${errorFixtureName}-error.ngc`,
|
||||
`/work/${errorFixtureName}-error.ngc`,
|
||||
);
|
||||
verifyExpectedFileError(
|
||||
`${errorFixtureName}_file`,
|
||||
@@ -5308,8 +5317,12 @@
|
||||
);
|
||||
|
||||
for (const fileFixtureName of INTERP_BROWSER_FILE_FIXTURES) {
|
||||
const programPath = `/work/${fileFixtureName}.ngc`;
|
||||
interp.writeTextFile(programPath, await fetchText(`../fixtures/gcode/${fileFixtureName}.ngc`));
|
||||
const programPath = await writeLocalGcodeFixture(
|
||||
interp,
|
||||
fileFixtureName,
|
||||
`/work/${fileFixtureName}.ngc`,
|
||||
`/work/${fileFixtureName}.ngc`,
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
`${fileFixtureName}_file`,
|
||||
interp.runFile(programPath),
|
||||
|
||||
Reference in New Issue
Block a user