Guard local INI/direct fixture staging
This commit is contained in:
@@ -4320,6 +4320,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function writeLocalIniFixture(interp, filename, wasmPath, expectedWasmPath) {
|
||||
if (wasmPath !== expectedWasmPath) {
|
||||
throw new Error(`browser_${filename}_local_ini_staging: path drift`);
|
||||
}
|
||||
interp.writeTextFile(wasmPath, await fetchText(`../fixtures/ini/${filename}`));
|
||||
return wasmPath;
|
||||
}
|
||||
|
||||
async function writeLocalGcodeFixture(interp, fixtureName, wasmPath, expectedWasmPath) {
|
||||
if (wasmPath !== expectedWasmPath) {
|
||||
throw new Error(`browser_${fixtureName}_local_gcode_staging: path drift`);
|
||||
@@ -5249,15 +5257,17 @@
|
||||
const spindleOrientOffsetExpectedText = (
|
||||
await fetchText(`../fixtures/canon/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.events`)
|
||||
).trimEnd();
|
||||
const spindleOrientOffsetIniPath = "/work/browser-spindle-orient-offset.ini";
|
||||
interp.writeTextFile(
|
||||
spindleOrientOffsetIniPath,
|
||||
await fetchText("../fixtures/ini/spindle_orient_offset.ini"),
|
||||
const spindleOrientOffsetIniPath = await writeLocalIniFixture(
|
||||
interp,
|
||||
"spindle_orient_offset.ini",
|
||||
"/work/browser-spindle-orient-offset.ini",
|
||||
"/work/browser-spindle-orient-offset.ini",
|
||||
);
|
||||
const disableFanucStyleSubIniPath = "/work/browser-disable-fanuc-style-sub.ini";
|
||||
interp.writeTextFile(
|
||||
disableFanucStyleSubIniPath,
|
||||
await fetchText("../fixtures/ini/disable_fanuc_style_sub.ini"),
|
||||
const disableFanucStyleSubIniPath = await writeLocalIniFixture(
|
||||
interp,
|
||||
"disable_fanuc_style_sub.ini",
|
||||
"/work/browser-disable-fanuc-style-sub.ini",
|
||||
"/work/browser-disable-fanuc-style-sub.ini",
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
||||
@@ -5353,18 +5363,23 @@
|
||||
baselineIniExpectedText,
|
||||
);
|
||||
|
||||
const spindleOrientOffsetPath = `/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`;
|
||||
interp.writeTextFile(spindleOrientOffsetPath, spindleOrientOffsetProgramText);
|
||||
const spindleOrientOffsetPath = await writeLocalGcodeFixture(
|
||||
interp,
|
||||
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
||||
`/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`,
|
||||
`/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`,
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
`${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}_file`,
|
||||
interp.runFileWithIni(spindleOrientOffsetPath, spindleOrientOffsetIniPath),
|
||||
spindleOrientOffsetExpectedText,
|
||||
);
|
||||
|
||||
const disableFanucStyleSubPath = "/work/browser-disable_fanuc_style_sub_m98.ngc";
|
||||
interp.writeTextFile(
|
||||
disableFanucStyleSubPath,
|
||||
await fetchText("../fixtures/gcode/disable_fanuc_style_sub_m98.ngc"),
|
||||
const disableFanucStyleSubPath = await writeLocalGcodeFixture(
|
||||
interp,
|
||||
"disable_fanuc_style_sub_m98",
|
||||
"/work/browser-disable_fanuc_style_sub_m98.ngc",
|
||||
"/work/browser-disable_fanuc_style_sub_m98.ngc",
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"browser_disable_fanuc_style_sub_m98_file",
|
||||
|
||||
Reference in New Issue
Block a user