Add flowsnake interpreter regression coverage

This commit is contained in:
2026-06-09 07:49:06 +08:00
parent 3698c51917
commit e7df5b3eda
12 changed files with 530 additions and 4 deletions

View File

@@ -1537,6 +1537,32 @@
].join("\n"),
);
const flowsnakePath = await writeInterpRegressionFile(
interp,
"flowsnake",
"flowsnake.ngc",
);
verifyExpectedOutput(
"browser_interp_flowsnake",
interp.runFile(flowsnakePath),
[
"file_open=0",
"file_read_count=6414",
"file_execute_count=6414",
"file_saw_error=0",
"canon_event=COMMENT: Program to mill a flowsnake",
"canon_event=START_SPINDLE_CLOCKWISE spindle=0",
"canon_event=STRAIGHT_TRAVERSE line=33 x=0.25 y=1 z=1",
"canon_event=STRAIGHT_FEED line=13 x=3.75 y=1 z=0",
"canon_event=STRAIGHT_FEED line=13 x=2 y=3.95 z=0",
"canon_event=STRAIGHT_FEED line=13 x=0.25 y=1 z=0",
"canon_event=STOP_SPINDLE_TURNING spindle=0",
"setup.current_x=0.25",
"setup.current_y=1",
"setup.current_z=1",
].join("\n"),
);
const g33_1Path = await writeInterpRegressionFile(interp, "g33.1", "g33.1.ngc");
verifyExpectedOutput(
"browser_interp_g33_1",

View File

@@ -210,6 +210,7 @@ check_exitcode linuxcnc_interp_minimal_harness.return_value.run
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.g33_1.run
check_exitcode linuxcnc_interp_minimal_harness.g6164.run
check_exitcode linuxcnc_interp_minimal_harness.rotation_abs_pts.run
@@ -1130,6 +1131,22 @@ grep -Fq "canon_event=USE_LENGTH_UNITS units=1" "$NAMEDPARAM_BUG424_STDOUT"
grep -Fq "canon_event=STRAIGHT_TRAVERSE line=5 x=2 y=3 z=4" "$NAMEDPARAM_BUG424_STDOUT"
grep -Fq "canon_event=PROGRAM_END" "$NAMEDPARAM_BUG424_STDOUT"
FLOWSNAKE_STDOUT="$BUILD_DIR/linuxcnc_interp_minimal_harness.flowsnake.run.stdout.log"
grep -Fq "file_open=0" "$FLOWSNAKE_STDOUT"
grep -Fq "file_read_count=6414" "$FLOWSNAKE_STDOUT"
grep -Fq "file_execute_count=6414" "$FLOWSNAKE_STDOUT"
grep -Fq "file_saw_error=0" "$FLOWSNAKE_STDOUT"
grep -Fq "canon_event=COMMENT: Program to mill a flowsnake" "$FLOWSNAKE_STDOUT"
grep -Fq "canon_event=START_SPINDLE_CLOCKWISE spindle=0" "$FLOWSNAKE_STDOUT"
grep -Fq "canon_event=STRAIGHT_TRAVERSE line=33 x=0.25 y=1 z=1" "$FLOWSNAKE_STDOUT"
grep -Fq "canon_event=STRAIGHT_FEED line=13 x=3.75 y=1 z=0" "$FLOWSNAKE_STDOUT"
grep -Fq "canon_event=STRAIGHT_FEED line=13 x=2 y=3.95 z=0" "$FLOWSNAKE_STDOUT"
grep -Fq "canon_event=STRAIGHT_FEED line=13 x=0.25 y=1 z=0" "$FLOWSNAKE_STDOUT"
grep -Fq "canon_event=STOP_SPINDLE_TURNING spindle=0" "$FLOWSNAKE_STDOUT"
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"
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"

View File

@@ -1249,6 +1249,28 @@ verifyExpectedOutput(
].join("\n"),
);
const flowsnakePath = writeInterpRegressionFile("flowsnake", "flowsnake.ngc");
verifyExpectedOutput(
"interp_flowsnake_wasm",
interp.runFile(flowsnakePath),
[
"file_open=0",
"file_read_count=6414",
"file_execute_count=6414",
"file_saw_error=0",
"canon_event=COMMENT: Program to mill a flowsnake",
"canon_event=START_SPINDLE_CLOCKWISE spindle=0",
"canon_event=STRAIGHT_TRAVERSE line=33 x=0.25 y=1 z=1",
"canon_event=STRAIGHT_FEED line=13 x=3.75 y=1 z=0",
"canon_event=STRAIGHT_FEED line=13 x=2 y=3.95 z=0",
"canon_event=STRAIGHT_FEED line=13 x=0.25 y=1 z=0",
"canon_event=STOP_SPINDLE_TURNING spindle=0",
"setup.current_x=0.25",
"setup.current_y=1",
"setup.current_z=1",
].join("\n"),
);
const g33_1Path = writeInterpRegressionFile("g33.1", "g33.1.ngc");
verifyExpectedOutput(
"interp_g33_1_wasm",