Guard local INI/direct fixture staging
This commit is contained in:
@@ -106,6 +106,15 @@ function writeVendorTextFile(sourcePath, wasmPath, targetInterp = interp) {
|
||||
targetInterp.writeTextFile(wasmPath, readFileSync(sourcePath, "utf8"));
|
||||
}
|
||||
|
||||
function writeLocalIniFixture(filename, wasmPath, expectedWasmPath, targetInterp = interp) {
|
||||
assert.equal(wasmPath, expectedWasmPath, `${filename} local ini staging path drift`);
|
||||
targetInterp.writeTextFile(
|
||||
wasmPath,
|
||||
readFileSync(resolve(rootDir, `tests/fixtures/ini/${filename}`), "utf8"),
|
||||
);
|
||||
return wasmPath;
|
||||
}
|
||||
|
||||
function writeLocalGcodeFixture(fixtureName, wasmPath, expectedWasmPath, targetInterp = interp) {
|
||||
assert.equal(wasmPath, expectedWasmPath, `${fixtureName} local gcode staging path drift`);
|
||||
targetInterp.writeTextFile(
|
||||
@@ -645,15 +654,15 @@ const spindleOrientOffsetExpected = readFileSync(
|
||||
resolve(rootDir, `tests/fixtures/canon/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.events`),
|
||||
"utf8",
|
||||
).trimEnd();
|
||||
const spindleOrientOffsetIniPath = "/work/spindle-orient-offset.ini";
|
||||
interp.writeTextFile(
|
||||
spindleOrientOffsetIniPath,
|
||||
readFileSync(resolve(rootDir, "tests/fixtures/ini/spindle_orient_offset.ini"), "utf8"),
|
||||
const spindleOrientOffsetIniPath = writeLocalIniFixture(
|
||||
"spindle_orient_offset.ini",
|
||||
"/work/spindle-orient-offset.ini",
|
||||
"/work/spindle-orient-offset.ini",
|
||||
);
|
||||
const disableFanucStyleSubIniPath = "/work/disable-fanuc-style-sub.ini";
|
||||
interp.writeTextFile(
|
||||
disableFanucStyleSubIniPath,
|
||||
readFileSync(resolve(rootDir, "tests/fixtures/ini/disable_fanuc_style_sub.ini"), "utf8"),
|
||||
const disableFanucStyleSubIniPath = writeLocalIniFixture(
|
||||
"disable_fanuc_style_sub.ini",
|
||||
"/work/disable-fanuc-style-sub.ini",
|
||||
"/work/disable-fanuc-style-sub.ini",
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE,
|
||||
@@ -753,18 +762,21 @@ verifyExpectedOutput(
|
||||
baselineIniExpected,
|
||||
);
|
||||
|
||||
const spindleOrientOffsetFilePath = `/work/${INTERP_SPINDLE_ORIENT_OFFSET_FIXTURE}.ngc`;
|
||||
interp.writeTextFile(spindleOrientOffsetFilePath, spindleOrientOffsetProgramText);
|
||||
const spindleOrientOffsetFilePath = writeLocalGcodeFixture(
|
||||
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(spindleOrientOffsetFilePath, spindleOrientOffsetIniPath),
|
||||
spindleOrientOffsetExpected,
|
||||
);
|
||||
|
||||
const disableFanucStyleSubFilePath = "/work/disable_fanuc_style_sub_m98.ngc";
|
||||
interp.writeTextFile(
|
||||
disableFanucStyleSubFilePath,
|
||||
readFileSync(resolve(rootDir, "tests/fixtures/gcode/disable_fanuc_style_sub_m98.ngc"), "utf8"),
|
||||
const disableFanucStyleSubFilePath = writeLocalGcodeFixture(
|
||||
"disable_fanuc_style_sub_m98",
|
||||
"/work/disable_fanuc_style_sub_m98.ngc",
|
||||
"/work/disable_fanuc_style_sub_m98.ngc",
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"disable_fanuc_style_sub_m98_file_wasm",
|
||||
|
||||
Reference in New Issue
Block a user