Guard ccomp per-file staging paths

This commit is contained in:
2026-06-13 12:53:55 +08:00
parent 08e10c7b5a
commit 5175444fe9
3 changed files with 82 additions and 18 deletions

View File

@@ -377,7 +377,7 @@ const ccompRegressionFiles = [
"test.tbl",
];
function assertCcompRegressionStaging(name, wasmDir) {
function assertCcompRegressionCoverage(name) {
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/ccomp", name);
assert.deepEqual(
readdirSync(sourceDir)
@@ -386,11 +386,16 @@ function assertCcompRegressionStaging(name, wasmDir) {
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 assertCcompRegressionFilesStaging(name, wasmDir) {
for (const file of ccompRegressionFiles) {
assert.equal(
`${wasmDir}/${file}`,
`/work/ccomp/${name}/${file}`,
`interp ccomp ${name}/${file} staging manifest drift`,
);
}
}
function writeG10RegressionFiles(name, files) {
@@ -1763,7 +1768,8 @@ verifyExpectedOutput(
);
const ccompLatheCompDir = writeCcompRegressionFiles("lathe-comp");
assertCcompRegressionStaging("lathe-comp", ccompLatheCompDir);
assertCcompRegressionCoverage("lathe-comp");
assertCcompRegressionFilesStaging("lathe-comp", ccompLatheCompDir);
verifyExpectedOutput(
"interp_ccomp_lathe_comp_wasm",
interp.runFileWithIni(`${ccompLatheCompDir}/test.ngc`, `${ccompLatheCompDir}/test.ini`),
@@ -1782,7 +1788,8 @@ verifyExpectedOutput(
);
const ccompMillG90G91G92Dir = writeCcompRegressionFiles("mill-g90g91g92");
assertCcompRegressionStaging("mill-g90g91g92", ccompMillG90G91G92Dir);
assertCcompRegressionCoverage("mill-g90g91g92");
assertCcompRegressionFilesStaging("mill-g90g91g92", ccompMillG90G91G92Dir);
verifyExpectedOutput(
"interp_ccomp_mill_g90g91g92_wasm",
interp.runFileWithIni(
@@ -1803,7 +1810,8 @@ verifyExpectedOutput(
);
const ccompMillLineArcEntryDir = writeCcompRegressionFiles("mill-line-arc-entry");
assertCcompRegressionStaging("mill-line-arc-entry", ccompMillLineArcEntryDir);
assertCcompRegressionCoverage("mill-line-arc-entry");
assertCcompRegressionFilesStaging("mill-line-arc-entry", ccompMillLineArcEntryDir);
verifyExpectedOutput(
"interp_ccomp_mill_line_arc_entry_wasm",
interp.runFileWithIni(
@@ -1824,7 +1832,8 @@ verifyExpectedOutput(
);
const ccompMillZchangesDir = writeCcompRegressionFiles("mill-zchanges");
assertCcompRegressionStaging("mill-zchanges", ccompMillZchangesDir);
assertCcompRegressionCoverage("mill-zchanges");
assertCcompRegressionFilesStaging("mill-zchanges", ccompMillZchangesDir);
verifyExpectedOutput(
"interp_ccomp_mill_zchanges_wasm",
interp.runFileWithIni(`${ccompMillZchangesDir}/test.ngc`, `${ccompMillZchangesDir}/test.ini`),