Add blocked runtime gate review coverage
This commit is contained in:
@@ -266,6 +266,35 @@ function writeInterpRegressionFiles(name, files) {
|
||||
return wasmDir;
|
||||
}
|
||||
|
||||
function interpRegressionNgcFiles(name) {
|
||||
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name);
|
||||
return readdirSync(sourceDir)
|
||||
.filter((filename) => filename.endsWith(".ngc"))
|
||||
.sort();
|
||||
}
|
||||
|
||||
function interpRegressionNgcFilesRecursive(name) {
|
||||
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/interp", name);
|
||||
const files = [];
|
||||
|
||||
function walk(relativeDir) {
|
||||
const directory = resolve(sourceDir, relativeDir);
|
||||
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
||||
const relativePath = relativeDir ? `${relativeDir}/${entry.name}` : entry.name;
|
||||
if (entry.isDirectory()) {
|
||||
walk(relativePath);
|
||||
continue;
|
||||
}
|
||||
if (entry.isFile() && entry.name.endsWith(".ngc")) {
|
||||
files.push(relativePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
walk("");
|
||||
return files.sort();
|
||||
}
|
||||
|
||||
function writeCcompRegressionFiles(name) {
|
||||
const sourceDir = resolve(rootDir, "vendor/linuxcnc/tests/ccomp", name);
|
||||
const wasmDir = `/work/ccomp/${name}`;
|
||||
@@ -1210,6 +1239,21 @@ verifyExpectedOutput(
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const doWhileBreakBugPath = writeInterpRegressionFile("do-while-break", "bug.ngc");
|
||||
verifyExpectedOutput(
|
||||
"interp_do_while_break_bug_wasm",
|
||||
interp.runFile(doWhileBreakBugPath),
|
||||
[
|
||||
"file_open=0",
|
||||
"file_read_count=7",
|
||||
"file_execute_count=7",
|
||||
"file_saw_error=0",
|
||||
"canon_event=PROGRAM_END",
|
||||
"absent=@end of do-while-loop",
|
||||
"absent=file_saw_error=1",
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const owordBug315Path = writeInterpRegressionFile("oword-bug315", "test.ngc");
|
||||
verifyExpectedOutput(
|
||||
"interp_oword_bug315_wasm",
|
||||
@@ -1550,7 +1594,7 @@ verifyExpectedOutput(
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
for (const badFixture of [
|
||||
const badInterpFixtures = [
|
||||
{
|
||||
name: "a_in_canned_cycle",
|
||||
file: "a-in-canned-cycle.ngc",
|
||||
@@ -1698,7 +1742,13 @@ for (const badFixture of [
|
||||
executeCount: 1,
|
||||
errorText: "All axes missing with motion code",
|
||||
},
|
||||
]) {
|
||||
];
|
||||
assert.deepEqual(
|
||||
badInterpFixtures.map((fixture) => fixture.file).sort(),
|
||||
interpRegressionNgcFiles("bad"),
|
||||
"interp bad fixture coverage drift",
|
||||
);
|
||||
for (const badFixture of badInterpFixtures) {
|
||||
const badPath = writeInterpRegressionFile("bad", badFixture.file);
|
||||
verifyExpectedOutput(
|
||||
`interp_bad_${badFixture.name}_wasm`,
|
||||
@@ -1733,7 +1783,7 @@ verifyExpectedOutput(
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
for (const goodArcFixture of [
|
||||
const goodArcFixtures = [
|
||||
{
|
||||
name: "big_imperial_center_format",
|
||||
file: "good-arc.big.imperial.center-format.ngc",
|
||||
@@ -1776,7 +1826,13 @@ for (const goodArcFixture of [
|
||||
firstEnd: 50,
|
||||
firstAxis: 24.986,
|
||||
},
|
||||
]) {
|
||||
];
|
||||
assert.deepEqual(
|
||||
goodArcFixtures.map((fixture) => fixture.file).sort(),
|
||||
interpRegressionNgcFiles("good"),
|
||||
"interp good fixture coverage drift",
|
||||
);
|
||||
for (const goodArcFixture of goodArcFixtures) {
|
||||
const goodArcPath = writeInterpRegressionFile("good", goodArcFixture.file);
|
||||
verifyExpectedOutput(
|
||||
`interp_good_arc_${goodArcFixture.name}_wasm`,
|
||||
@@ -1952,6 +2008,16 @@ verifyExpectedOutput(
|
||||
);
|
||||
|
||||
const rotationAbsPtsPath = writeInterpRegressionFile("rotation/abs-pts", "test.ngc");
|
||||
const rotationRegressionFiles = [
|
||||
"abs-pts/test.ngc",
|
||||
"g28/g28.ngc",
|
||||
"g53/g53.ngc",
|
||||
];
|
||||
assert.deepEqual(
|
||||
rotationRegressionFiles,
|
||||
interpRegressionNgcFilesRecursive("rotation"),
|
||||
"interp_rotation_fixture_coverage: upstream .ngc manifest",
|
||||
);
|
||||
const rotationAbsPtsOutput = interp.runFile(rotationAbsPtsPath);
|
||||
verifyExpectedOutput(
|
||||
"interp_rotation_abs_pts_wasm",
|
||||
@@ -2198,6 +2264,14 @@ const magicCommentsParamFormatPath = writeInterpRegressionFile(
|
||||
"magic_comments/param_format_printing",
|
||||
"test.ngc",
|
||||
);
|
||||
const magicCommentsRegressionFiles = [
|
||||
"param_format_printing/test.ngc",
|
||||
];
|
||||
assert.deepEqual(
|
||||
magicCommentsRegressionFiles,
|
||||
interpRegressionNgcFilesRecursive("magic_comments"),
|
||||
"interp_magic_comments_fixture_coverage: upstream .ngc manifest",
|
||||
);
|
||||
verifyExpectedOutput(
|
||||
"interp_magic_comments_param_format_wasm",
|
||||
interp.runFile(magicCommentsParamFormatPath),
|
||||
@@ -2218,6 +2292,38 @@ verifyExpectedOutput(
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
const m98m99RegressionFiles = [
|
||||
"01-basics/test.ngc",
|
||||
"02-variables/test.ngc",
|
||||
"03-error-M98-no-P-word/test.ngc",
|
||||
"04-M98-but-no-sub/test.ngc",
|
||||
"05-M98-loops/test.ngc",
|
||||
"06-error-mixed-sub-styles/O...-called-with-O..._call.ngc",
|
||||
"06-error-mixed-sub-styles/O...-ended-with-O..._endsub.ngc",
|
||||
"06-error-mixed-sub-styles/O...-sub-called-with-M98.ngc",
|
||||
"06-error-mixed-sub-styles/O...-sub-ended-with-M99.ngc",
|
||||
"07-nested-subs/test.ngc",
|
||||
"08-sub-follows-main/test.ngc",
|
||||
"09-disable-fanuc-subs/test-fanuc.ngc",
|
||||
"09-disable-fanuc-subs/test-rs274ngc.ngc",
|
||||
"10-M98-P001/test.ngc",
|
||||
"11-main-program-oword/test-illegal-end-main-with-eof.ngc",
|
||||
"11-main-program-oword/test-illegal-no-m30-before-osub.ngc",
|
||||
"11-main-program-oword/test-illegal-sub-after-percent.ngc",
|
||||
"11-main-program-oword/test-legal-end-main-with-m02.ngc",
|
||||
"11-main-program-oword/test-legal-end-main-with-m2.ngc",
|
||||
"11-main-program-oword/test-legal-end-main-with-m30.ngc",
|
||||
"11-main-program-oword/test-legal-end-main-with-percent.ngc",
|
||||
"13-named-program/test-named.ngc",
|
||||
"13-named-program/test-numbered.ngc",
|
||||
"14-o-expression-call/test.ngc",
|
||||
];
|
||||
assert.deepEqual(
|
||||
m98m99RegressionFiles,
|
||||
interpRegressionNgcFilesRecursive("m98m99"),
|
||||
"interp m98m99 fixture coverage drift",
|
||||
);
|
||||
|
||||
const m98m99BasicsPath = writeInterpRegressionFile("m98m99/01-basics", "test.ngc");
|
||||
verifyExpectedOutput(
|
||||
"interp_m98m99_01_basics_wasm",
|
||||
|
||||
Reference in New Issue
Block a user