Guard tool-table direct staging
This commit is contained in:
@@ -4459,6 +4459,19 @@
|
||||
return checkedPath;
|
||||
}
|
||||
|
||||
function generatedToolTablePath(wasmPath, expectedWasmPath) {
|
||||
if (wasmPath !== expectedWasmPath) {
|
||||
throw new Error(`browser_tool_table_fixture_${expectedWasmPath}: path drift`);
|
||||
}
|
||||
return wasmPath;
|
||||
}
|
||||
|
||||
function writeGeneratedToolTableFixture(interp, wasmPath, expectedWasmPath, text) {
|
||||
const checkedPath = generatedToolTablePath(wasmPath, expectedWasmPath);
|
||||
interp.writeTextFile(checkedPath, text);
|
||||
return checkedPath;
|
||||
}
|
||||
|
||||
async function loadSimMachineFiles(machineRel, iniFile, programFile = null) {
|
||||
const iniText = await fetchText(
|
||||
`../../vendor/linuxcnc/configs/sim/${machineRel}/${iniFile}`,
|
||||
@@ -8832,9 +8845,10 @@
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const browserToolTablePath = "/work/browser-direct-tool.tbl";
|
||||
interp.writeTextFile(
|
||||
browserToolTablePath,
|
||||
const browserToolTablePath = writeGeneratedToolTableFixture(
|
||||
interp,
|
||||
"/work/browser-direct-tool.tbl",
|
||||
"/work/browser-direct-tool.tbl",
|
||||
[
|
||||
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser direct finish tool",
|
||||
"T5 P9 X1 Y2 Z3 ;browser direct rough tool",
|
||||
@@ -8888,9 +8902,10 @@
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const browserRandomToolTablePath = "/work/browser-direct-random-tool.tbl";
|
||||
interp.writeTextFile(
|
||||
browserRandomToolTablePath,
|
||||
const browserRandomToolTablePath = writeGeneratedToolTableFixture(
|
||||
interp,
|
||||
"/work/browser-direct-random-tool.tbl",
|
||||
"/work/browser-direct-random-tool.tbl",
|
||||
[
|
||||
"T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser direct random finish tool",
|
||||
"T5 P9 X1 Y2 Z3 ;browser direct random rough tool",
|
||||
|
||||
Reference in New Issue
Block a user