Add selected bad interpreter error fixtures
This commit is contained in:
@@ -1563,6 +1563,51 @@
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
for (const badFixture of [
|
||||
{
|
||||
name: "nested",
|
||||
file: "nested.ngc",
|
||||
readCount: 6,
|
||||
executeCount: 5,
|
||||
errorText: "Nested subroutine definition",
|
||||
},
|
||||
{
|
||||
name: "no_feed_rate",
|
||||
file: "no-feed-rate.ngc",
|
||||
readCount: 2,
|
||||
executeCount: 2,
|
||||
errorText: "Cannot do g1 with zero feed rate",
|
||||
},
|
||||
{
|
||||
name: "no_ijr",
|
||||
file: "no-ijr.ngc",
|
||||
readCount: 2,
|
||||
executeCount: 2,
|
||||
errorText: "R i j k words all missing for arc",
|
||||
},
|
||||
{
|
||||
name: "probe_no_axes",
|
||||
file: "probe-no-axes.ngc",
|
||||
readCount: 2,
|
||||
executeCount: 1,
|
||||
errorText: "All axes missing with motion code",
|
||||
},
|
||||
]) {
|
||||
const badPath = await writeInterpRegressionFile(interp, "bad", badFixture.file);
|
||||
verifyExpectedOutput(
|
||||
`browser_interp_bad_${badFixture.name}`,
|
||||
interp.runFile(badPath),
|
||||
[
|
||||
"file_open=0",
|
||||
`file_read_count=${badFixture.readCount}`,
|
||||
`file_execute_count=${badFixture.executeCount}`,
|
||||
"file_saw_error=1",
|
||||
`file_error_text=${badFixture.errorText}`,
|
||||
"canon_event=ON_RESET",
|
||||
].join("\n"),
|
||||
);
|
||||
}
|
||||
|
||||
const g33_1Path = await writeInterpRegressionFile(interp, "g33.1", "g33.1.ngc");
|
||||
verifyExpectedOutput(
|
||||
"browser_interp_g33_1",
|
||||
|
||||
@@ -211,6 +211,10 @@ check_exitcode linuxcnc_interp_minimal_harness.subs_follow_main.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.fractional_linenumbers.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.namedparam_bug424.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.flowsnake.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.bad_nested.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.bad_no_feed_rate.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.bad_no_ijr.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.bad_probe_no_axes.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.g33_1.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.g6164.run
|
||||
check_exitcode linuxcnc_interp_minimal_harness.rotation_abs_pts.run
|
||||
@@ -1147,6 +1151,38 @@ grep -Fq "setup.current_x=0.25" "$FLOWSNAKE_STDOUT"
|
||||
grep -Fq "setup.current_y=1" "$FLOWSNAKE_STDOUT"
|
||||
grep -Fq "setup.current_z=1" "$FLOWSNAKE_STDOUT"
|
||||
|
||||
BAD_NESTED_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.bad_nested.run.stdout.log"
|
||||
grep -Fq "file_open=0" "$BAD_NESTED_STDOUT"
|
||||
grep -Fq "file_read_count=6" "$BAD_NESTED_STDOUT"
|
||||
grep -Fq "file_execute_count=5" "$BAD_NESTED_STDOUT"
|
||||
grep -Fq "file_saw_error=1" "$BAD_NESTED_STDOUT"
|
||||
grep -Fq "file_error_text=Nested subroutine definition" "$BAD_NESTED_STDOUT"
|
||||
grep -Fq "canon_event=ON_RESET" "$BAD_NESTED_STDOUT"
|
||||
|
||||
BAD_NO_FEED_RATE_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.bad_no_feed_rate.run.stdout.log"
|
||||
grep -Fq "file_open=0" "$BAD_NO_FEED_RATE_STDOUT"
|
||||
grep -Fq "file_read_count=2" "$BAD_NO_FEED_RATE_STDOUT"
|
||||
grep -Fq "file_execute_count=2" "$BAD_NO_FEED_RATE_STDOUT"
|
||||
grep -Fq "file_saw_error=1" "$BAD_NO_FEED_RATE_STDOUT"
|
||||
grep -Fq "file_error_text=Cannot do g1 with zero feed rate" "$BAD_NO_FEED_RATE_STDOUT"
|
||||
grep -Fq "canon_event=ON_RESET" "$BAD_NO_FEED_RATE_STDOUT"
|
||||
|
||||
BAD_NO_IJR_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.bad_no_ijr.run.stdout.log"
|
||||
grep -Fq "file_open=0" "$BAD_NO_IJR_STDOUT"
|
||||
grep -Fq "file_read_count=2" "$BAD_NO_IJR_STDOUT"
|
||||
grep -Fq "file_execute_count=2" "$BAD_NO_IJR_STDOUT"
|
||||
grep -Fq "file_saw_error=1" "$BAD_NO_IJR_STDOUT"
|
||||
grep -Fq "file_error_text=R i j k words all missing for arc" "$BAD_NO_IJR_STDOUT"
|
||||
grep -Fq "canon_event=ON_RESET" "$BAD_NO_IJR_STDOUT"
|
||||
|
||||
BAD_PROBE_NO_AXES_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.bad_probe_no_axes.run.stdout.log"
|
||||
grep -Fq "file_open=0" "$BAD_PROBE_NO_AXES_STDOUT"
|
||||
grep -Fq "file_read_count=2" "$BAD_PROBE_NO_AXES_STDOUT"
|
||||
grep -Fq "file_execute_count=1" "$BAD_PROBE_NO_AXES_STDOUT"
|
||||
grep -Fq "file_saw_error=1" "$BAD_PROBE_NO_AXES_STDOUT"
|
||||
grep -Fq "file_error_text=All axes missing with motion code" "$BAD_PROBE_NO_AXES_STDOUT"
|
||||
grep -Fq "canon_event=ON_RESET" "$BAD_PROBE_NO_AXES_STDOUT"
|
||||
|
||||
G33_1_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.g33_1.run.stdout.log"
|
||||
grep -Fq "file_open=0" "$G33_1_STDOUT"
|
||||
grep -Fq "file_read_count=5" "$G33_1_STDOUT"
|
||||
|
||||
@@ -1271,6 +1271,51 @@ verifyExpectedOutput(
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
for (const badFixture of [
|
||||
{
|
||||
name: "nested",
|
||||
file: "nested.ngc",
|
||||
readCount: 6,
|
||||
executeCount: 5,
|
||||
errorText: "Nested subroutine definition",
|
||||
},
|
||||
{
|
||||
name: "no_feed_rate",
|
||||
file: "no-feed-rate.ngc",
|
||||
readCount: 2,
|
||||
executeCount: 2,
|
||||
errorText: "Cannot do g1 with zero feed rate",
|
||||
},
|
||||
{
|
||||
name: "no_ijr",
|
||||
file: "no-ijr.ngc",
|
||||
readCount: 2,
|
||||
executeCount: 2,
|
||||
errorText: "R i j k words all missing for arc",
|
||||
},
|
||||
{
|
||||
name: "probe_no_axes",
|
||||
file: "probe-no-axes.ngc",
|
||||
readCount: 2,
|
||||
executeCount: 1,
|
||||
errorText: "All axes missing with motion code",
|
||||
},
|
||||
]) {
|
||||
const badPath = writeInterpRegressionFile("bad", badFixture.file);
|
||||
verifyExpectedOutput(
|
||||
`interp_bad_${badFixture.name}_wasm`,
|
||||
interp.runFile(badPath),
|
||||
[
|
||||
"file_open=0",
|
||||
`file_read_count=${badFixture.readCount}`,
|
||||
`file_execute_count=${badFixture.executeCount}`,
|
||||
"file_saw_error=1",
|
||||
`file_error_text=${badFixture.errorText}`,
|
||||
"canon_event=ON_RESET",
|
||||
].join("\n"),
|
||||
);
|
||||
}
|
||||
|
||||
const g33_1Path = writeInterpRegressionFile("g33.1", "g33.1.ngc");
|
||||
verifyExpectedOutput(
|
||||
"interp_g33_1_wasm",
|
||||
|
||||
Reference in New Issue
Block a user