Guard ccomp staging paths

This commit is contained in:
2026-06-13 08:06:19 +08:00
parent 10cae98a9e
commit 0588cec429
3 changed files with 88 additions and 0 deletions

View File

@@ -315,6 +315,27 @@ function writeCcompRegressionFiles(name) {
return wasmDir;
}
const ccompRegressionFiles = [
"test.ngc",
"test.tbl",
];
function assertCcompRegressionStaging(name, wasmDir) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/ccomp", name);
assert.deepEqual(
readdirSync(sourceDir)
.filter((filename) => filename.endsWith(".ngc") || filename.endsWith(".tbl"))
.sort(),
ccompRegressionFiles,
`interp ccomp ${name} fixture coverage drift`,
);
assert.deepEqual(
ccompRegressionFiles.map((file) => `${wasmDir}/${file}`),
ccompRegressionFiles.map((file) => `/work/ccomp/${name}/${file}`),
`interp ccomp ${name} staging manifest drift`,
);
}
function writeG10RegressionFiles(name, files) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp/g10", name);
const wasmDir = `/work/interp/g10/${name}`;
@@ -1716,6 +1737,7 @@ verifyExpectedOutput(
);
const ccompLatheCompDir = writeCcompRegressionFiles("lathe-comp");
assertCcompRegressionStaging("lathe-comp", ccompLatheCompDir);
verifyExpectedOutput(
"interp_ccomp_lathe_comp_wasm",
interp.runFileWithIni(`${ccompLatheCompDir}/test.ngc`, `${ccompLatheCompDir}/test.ini`),
@@ -1734,6 +1756,7 @@ verifyExpectedOutput(
);
const ccompMillG90G91G92Dir = writeCcompRegressionFiles("mill-g90g91g92");
assertCcompRegressionStaging("mill-g90g91g92", ccompMillG90G91G92Dir);
verifyExpectedOutput(
"interp_ccomp_mill_g90g91g92_wasm",
interp.runFileWithIni(
@@ -1754,6 +1777,7 @@ verifyExpectedOutput(
);
const ccompMillLineArcEntryDir = writeCcompRegressionFiles("mill-line-arc-entry");
assertCcompRegressionStaging("mill-line-arc-entry", ccompMillLineArcEntryDir);
verifyExpectedOutput(
"interp_ccomp_mill_line_arc_entry_wasm",
interp.runFileWithIni(
@@ -1774,6 +1798,7 @@ verifyExpectedOutput(
);
const ccompMillZchangesDir = writeCcompRegressionFiles("mill-zchanges");
assertCcompRegressionStaging("mill-zchanges", ccompMillZchangesDir);
verifyExpectedOutput(
"interp_ccomp_mill_zchanges_wasm",
interp.runFileWithIni(`${ccompMillZchangesDir}/test.ngc`, `${ccompMillZchangesDir}/test.ini`),