Add selected bad interpreter error fixtures

This commit is contained in:
2026-06-09 08:01:40 +08:00
parent e7df5b3eda
commit 45420b055a
12 changed files with 164 additions and 4 deletions

View File

@@ -459,7 +459,7 @@ The validation fails if:
| Harness | Purpose |
| --- | --- |
| `tests/wasm/node/verify_ini_wasm.sh` | Validates the browser-facing INI WASM module can be built from vendored LinuxCNC `inifile.cc`, loaded through the JS SDK in Node, and queried through the exported C ABI, including LinuxCNC-backed boolean conversion and machine-session file-name string lookup. |
| `tests/wasm/node/verify_interp_wasm.sh` | Validates the interpreter-core WASM module can be built from vendored LinuxCNC interpreter/remap source, loaded through the interpreter JS SDK, run the first fixture group through `Interp::execute()` and selected file fixtures plus vendored upstream `tests/interp` regression files through `Interp::open()`/`read()`/`execute()`, match the native canonical event plus required state readback fixtures, emit `run_step` execution-status records with LinuxCNC line number, encoded source statement, return code, and interpreter axis positions for file execution, cover vendored `tests/interp/flowsnake` recursive O-word file execution and `tests/interp/g33.1` rigid-tap file execution, run vendored `xyzac-trt`/`xyzbc-trt` switchkins remap demo files through the WASM C ABI/SDK path, and run parameter-file restore/save through vendored LinuxCNC `Interp::restore_parameters()` and `Interp::save_parameters()`. |
| `tests/wasm/node/verify_interp_wasm.sh` | Validates the interpreter-core WASM module can be built from vendored LinuxCNC interpreter/remap source, loaded through the interpreter JS SDK, run the first fixture group through `Interp::execute()` and selected file fixtures plus vendored upstream `tests/interp` regression files through `Interp::open()`/`read()`/`execute()`, match the native canonical event plus required state readback fixtures, emit `run_step` execution-status records with LinuxCNC line number, encoded source statement, return code, and interpreter axis positions for file execution, cover vendored `tests/interp/flowsnake` recursive O-word file execution, selected `tests/interp/bad` file-error paths, and `tests/interp/g33.1` rigid-tap file execution, run vendored `xyzac-trt`/`xyzbc-trt` switchkins remap demo files through the WASM C ABI/SDK path, and run parameter-file restore/save through vendored LinuxCNC `Interp::restore_parameters()` and `Interp::save_parameters()`. |
| `tests/wasm/node/verify_sim_configs_wasm.sh` | Validates representative vendored LinuxCNC `configs/sim` programs in Node WASM through `planSimConfigStaging()` plus `runSimConfigProgram()`. The staging planner uses INI text and `tools/source-manifest.txt` to collect the program, INI, tool table, parameter file when vendored, `SUBROUTINE_PATH` files, `USER_M_PATH` files, and remap-NGC files before forwarding to `runFileWithIni()` or `runFiveAxisRemapFile()`. This covers INI-driven `U/V/W` axis mask handling, real `USER_M_PATH` registration for executable `M110`/`M111`, all four current external-offset M111 expected-failure programs, `SUBROUTINE_PATH` staging for `opa_demo.ngc -> circles.ngc`, bridge-mill remap-subroutine staging, and vendored LinuxCNC bridge-mill NGC remap execution without spawning host processes. The same smoke includes a synthetic staging-plan assertion for `TOOL_TABLE`, `PARAMETER_FILE`, `SUBROUTINE_PATH`, and `USER_M_PATH` collection. |
| `tests/wasm/node/verify_nc_files_wasm.sh` | Validates representative vendored LinuxCNC `nc_files` examples in Node WASM by copying `3D_Chips.ngc`, `arcspiral.ngc`, `hole-circle.ngc`, `factorial.ngc`, and `m6demo.ngc` into the Emscripten filesystem and forwarding to the LinuxCNC-backed `Interp::open()`/`read()`/`execute()` path. `3D_Chips.ngc` is staged with a minimal INI-declared `tool.tbl` because the upstream program contains `T1 M6`; JavaScript only stages files and checks LinuxCNC output, including `run_step` status records, and does not implement G-code, O-word, tool-change, or M-code behavior. |
| `tests/wasm/node/verify_tp_wasm.sh` | Validates a standalone trajectory-planner WASM module can be built from vendored LinuxCNC TP/TC/Ruckig support source, loaded in Node, and run the same linear, arc, and queued-line planner probe paths covered by the native TP harness. |
@@ -785,8 +785,9 @@ numbered-parameter, local named-parameter plus `_ini[...]` lookup through
tool-reload, tool select/change/length-offset, M61 current-tool-number update,
canned-cycle, state-tag motion, tool-table setup, and O-word subroutine
fixtures, plus vendored `tests/interp/flowsnake` recursive O-word toolpath,
threading/rigid tap, vendored `tests/interp/g33.1` rigid-tap file execution,
NURBS dispatch boundaries, and the
selected upstream `tests/interp/bad` file-error paths, threading/rigid tap,
vendored `tests/interp/g33.1` rigid-tap file execution, NURBS dispatch
boundaries, and the
comparable canonical runtime edge and program-end cleanup calls. The
standalone vendored-source harness, Node WASM smoke, and browser smoke also
pin `coordinate_offsets` MDI/file-path, `feed_control_modes`, `run_step`

View File

@@ -81,6 +81,7 @@ wasm-port/tests/host/verify_host_smokes.sh
| `tests/interp/fractional-linenumbers` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/fractional-linenumbers`; validates LinuxCNC fractional line-number parsing through vendored file execution paths. |
| `tests/interp/namedparam-bug424` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/namedparam-bug424`; validates LinuxCNC named-parameter parsing regression behavior through vendored file execution paths. |
| `tests/interp/flowsnake` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/flowsnake`; validates LinuxCNC recursive O-word subroutine execution, expression evaluation, and comment argument handling through a pure file-execution fractal toolpath. |
| `tests/interp/bad` selected file errors | Done | Native, WASM Node, browser | Vendored selected upstream files under `wasm-port/vendor/linuxcnc/tests/interp/bad`; validates LinuxCNC file-execution error text for nested subroutine definitions, zero-feed G1, missing arc center/radius words, and probe motion without axes. |
| `tests/interp/g33.1` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/g33.1`; validates LinuxCNC rigid-tap `G33.1` file execution, spindle start, feed synchronization, and `RIGID_TAP` canonical output through vendored interpreter paths. |
| `tests/interp/rotation` selected pure interpreter cases | Done | Native, WASM Node, browser | Vendored selected upstream cases under `wasm-port/vendor/linuxcnc/tests/interp/rotation`; validates LinuxCNC machine-coordinate `G53` absolute-position named parameters `#<_abs_x>`, `#<_abs_y>`, and `#<_abs_z>` across G54 offsets, G92 offsets, XY rotation, and inch/millimeter modes, plus rotated-coordinate `G28` and `G53` endpoint behavior through vendored file execution paths. |
| `tests/interp/iniparam` | Done | Native, WASM Node, browser | Vendored under `wasm-port/vendor/linuxcnc/tests/interp/iniparam`; validates LinuxCNC `_ini[...]` lookup, missing INI-parameter error text, and continued file execution through vendored file execution paths and `INI_FILE_NAME`. |

View File

@@ -44,7 +44,7 @@ Current validation is intentionally mechanical:
| Representative sim-config machine programs | `configs/sim/axis/foam/*`, `configs/sim/axis/geometry/M110`, `xyzc.ini`, `xyzc.ngc`, `configs/sim/axis/external_offsets/M111`, `dyn_demo.ngc`, `dynamic_offsets.ini`, `eoffsets.ngc`, `eoffsets.ini`, `jwp_z.ngc`, `jwp_z.ini`, `opa_demo.ngc`, `opa.ini`, `circles.ngc`, `eoffset.tbl`, and `configs/sim/axis/sim.tbl` | Copy unchanged | The `foam`, `xyzc`, and external-offset sample programs remain LinuxCNC sim-config assets. The standalone boundary only copies INI, tool table, G-code, executable user-M files, and `SUBROUTINE_PATH` files into the native or WASM filesystem, then calls vendored LinuxCNC INI parsing and `Interp::open()`/`read()`/`execute()` through the existing machine-config adapter. The native sim-config harness now prefers `[DISPLAY]OPEN_FILE` when several INI files live beside a program, so each program is judged with its corresponding machine context. The JS SDK `runSimConfigProgram()` is only the host file-staging helper for this boundary: it writes caller-provided text files to the Emscripten filesystem, applies executable bits, and forwards to LinuxCNC-backed C ABI entry points. `M110`/`M111` process execution stays a runtime boundary represented by deterministic `USER_M_COMMAND` canonical events | Vendor byte sync, `tests/native/verify_sim_configs.sh`, `tests/wasm/node/verify_sim_configs_wasm.sh`, `tests/browser/verify_interp_browser.sh` |
| Representative `nc_files` examples | `nc_files/3D_Chips.ngc`, `nc_files/arcspiral.ngc`, `nc_files/factorial.ngc`, `nc_files/hole-circle.ngc`, `nc_files/m6demo.ngc` | Copy unchanged | These upstream `linuxcnc/nc_files` examples are copied byte-for-byte into the WASM vendor tree after the native `nc_files` harness classifies the broader directory. Node and browser tests only stage the original `.ngc` text and, for `3D_Chips.ngc`, the minimal INI-declared tool table context required by its upstream `T1 M6` line in the Emscripten filesystem, then call the LinuxCNC-backed `Interp::open()`, `read()`, and `execute()` path through the existing SDK; no G-code, O-word, tool-change, or M-code behavior is implemented in JavaScript | Vendor byte sync, `tests/native/verify_nc_files.sh`, `tests/wasm/node/verify_nc_files_wasm.sh`, `tests/browser/verify_interp_browser.sh`, `tests/host/verify_host_smokes.sh` |
| LinuxCNC remap regression fixtures | `tests/remap/duplicate-o-word/*`, `tests/remap/fail/args.0/*`, `tests/remap/fail/args.1/*`, `tests/remap/fail/args.2/*`, `tests/remap/fail/body-ngc/*`, `tests/remap/m30-interaction/*`, `tests/remap/nested-remaps-oword/*`, `tests/remap/posargs.0/*`, `tests/remap/sequencing/*`, selected NGC-only `tests/remap/remap-io/test-ngc.ini` plus `io_*.ngc`, and `src/emc/rs274ngc/interp_remap.cc` plus `interp_o_word.cc` | Copy unchanged | The upstream duplicate O-word, NGC-only remap failure, M30/remap-level interaction, nested O-word remap, positional-argument remap, G/M remap sequencing, and remap-IO NGC subroutine regressions remain LinuxCNC REMAP/O-word/file or MDI execution tests. The standalone boundary only copies the upstream test files into native or WASM filesystems, reads LinuxCNC INI `SUBROUTINE_PATH`, `REMAP`, and `OWORD_NARGS` entries, and calls vendored `Interp::parse_remap()`, `open()`, `read()`, and `execute()` or feeds the upstream remap-IO MDI sequence into vendored `Interp::execute()`; the continue-on-error runner path only mirrors LinuxCNC `rs274 -n 0` test execution and does not implement duplicate-label, O-word, nested remap, M30, positional-argument, failure, sequencing, M62-M68, M66 input, or remap semantics | Vendor byte sync, `linuxcnc_duplicate_oword_remap_harness`, `tests/wasm/node/verify_interp_wasm.sh`, `tests/browser/verify_interp_browser.sh` |
| LinuxCNC interpreter regression fixtures | `tests/interp/do-while-break/*`, `tests/interp/oword-bug315/*`, `tests/interp/oword-bug315-p2/*`, `tests/interp/exists/*`, `tests/interp/return-value/*`, `tests/interp/subs-follow-main/*`, `tests/interp/fractional-linenumbers/*`, `tests/interp/namedparam-bug424/*`, `tests/interp/flowsnake/*`, `tests/interp/g33.1/*`, selected `tests/interp/rotation/*` pure interpreter cases, `tests/interp/iniparam/*`, `tests/interp/iniparam-failassign/*`, `tests/interp/m19/*`, `tests/interp/magic_comments/param_format_printing/*`, selected `tests/interp/m98m99/*` pure interpreter cases, `tests/interp/sub-call-from-sub/*`, `tests/interp/sequence-number/*`, `tests/interp/nested-sub-error/*`, `tests/interp/nested-sub-in-file-error/*`, `tests/interp/abort-hot-comment/*`, plus vendored interpreter/O-word sources including `interp_o_word.cc`, `interp_read.cc`, `interp_execute.cc`, `interp_find.cc`, `interp_namedparams.cc`, and `rs274ngc_pre.cc` | Copy unchanged | The upstream do/while/break, O-word bug315, `EXISTS[]`, subroutine return-value, subs-after-main, fractional line-number, named-parameter, recursive O-word flowsnake toolpath, rigid-tap `G33.1`, selected rotation/G53/G28 absolute-position and endpoint, INI named-parameter lookup/read-only protection, M19 spindle-orient offset/timeout handling, magic-comment parameter formatting, selected Fanuc `M98/M99` and O-expression call regressions, external-subroutine-call, external-subroutine line-number, nested-subroutine-definition rejection, blocked forward-seek-to-later-numbered-sub, and `(ABORT,...)` hot-comment parameter-expansion regressions remain LinuxCNC interpreter file-execution tests. The standalone boundary only vendors the original upstream assets, copies `*.ngc`, `test.ini`, `test.tbl`, `subs/*.ngc`, and referenced external subroutine `.ngc` files into native or WASM filesystems where applicable, sets the LinuxCNC `INI_FILE_NAME` runtime edge for `_ini[...]`, applies LinuxCNC INI machine settings such as `[RS274NGC]ORIENT_OFFSET`, reads LinuxCNC INI `SUBROUTINE_PATH`, captures LinuxCNC `(PRINT,...)` output through the existing stdout/Emscripten `print` boundary, and calls vendored `Interp::open()`, `read()`, and `execute()`; it does not implement O-word loop, break, subroutine, dynamic call, `M98/M99`, `EXISTS[]`, named-parameter, recursive O-word toolpath generation, rigid tap, absolute-position named-parameter, G28/G53 endpoint, INI-variable, read-only parameter, line-number, spindle-speed, spindle-orient, magic-comment formatting, subroutine lookup, ABORT hot-comment, error, or branch semantics | Vendor byte sync, `linuxcnc_interp_minimal_harness`, `tests/wasm/node/verify_interp_wasm.sh`, `tests/browser/verify_interp_browser.sh` |
| LinuxCNC interpreter regression fixtures | `tests/interp/do-while-break/*`, `tests/interp/oword-bug315/*`, `tests/interp/oword-bug315-p2/*`, `tests/interp/exists/*`, `tests/interp/return-value/*`, `tests/interp/subs-follow-main/*`, `tests/interp/fractional-linenumbers/*`, `tests/interp/namedparam-bug424/*`, `tests/interp/flowsnake/*`, selected `tests/interp/bad/*.ngc` file-error fixtures, `tests/interp/g33.1/*`, selected `tests/interp/rotation/*` pure interpreter cases, `tests/interp/iniparam/*`, `tests/interp/iniparam-failassign/*`, `tests/interp/m19/*`, `tests/interp/magic_comments/param_format_printing/*`, selected `tests/interp/m98m99/*` pure interpreter cases, `tests/interp/sub-call-from-sub/*`, `tests/interp/sequence-number/*`, `tests/interp/nested-sub-error/*`, `tests/interp/nested-sub-in-file-error/*`, `tests/interp/abort-hot-comment/*`, plus vendored interpreter/O-word sources including `interp_o_word.cc`, `interp_read.cc`, `interp_execute.cc`, `interp_find.cc`, `interp_namedparams.cc`, and `rs274ngc_pre.cc` | Copy unchanged | The upstream do/while/break, O-word bug315, `EXISTS[]`, subroutine return-value, subs-after-main, fractional line-number, named-parameter, recursive O-word flowsnake toolpath, selected file-execution error cases, rigid-tap `G33.1`, selected rotation/G53/G28 absolute-position and endpoint, INI named-parameter lookup/read-only protection, M19 spindle-orient offset/timeout handling, magic-comment parameter formatting, selected Fanuc `M98/M99` and O-expression call regressions, external-subroutine-call, external-subroutine line-number, nested-subroutine-definition rejection, blocked forward-seek-to-later-numbered-sub, and `(ABORT,...)` hot-comment parameter-expansion regressions remain LinuxCNC interpreter file-execution tests. The standalone boundary only vendors the original upstream assets, copies `*.ngc`, `test.ini`, `test.tbl`, `subs/*.ngc`, and referenced external subroutine `.ngc` files into native or WASM filesystems where applicable, sets the LinuxCNC `INI_FILE_NAME` runtime edge for `_ini[...]`, applies LinuxCNC INI machine settings such as `[RS274NGC]ORIENT_OFFSET`, reads LinuxCNC INI `SUBROUTINE_PATH`, captures LinuxCNC `(PRINT,...)` output through the existing stdout/Emscripten `print` boundary, and calls vendored `Interp::open()`, `read()`, and `execute()`; it does not implement O-word loop, break, subroutine, dynamic call, `M98/M99`, `EXISTS[]`, named-parameter, recursive O-word toolpath generation, rigid tap, absolute-position named-parameter, G28/G53 endpoint, INI-variable, read-only parameter, line-number, spindle-speed, spindle-orient, magic-comment formatting, subroutine lookup, ABORT hot-comment, error, or branch semantics | Vendor byte sync, `linuxcnc_interp_minimal_harness`, `tests/wasm/node/verify_interp_wasm.sh`, `tests/browser/verify_interp_browser.sh` |
| Additional non-switchable kinematics | `src/emc/kinematics/corexykins.c`, `rotatekins.c`, `rosekins.c`, `maxkins.c`, `lineardeltakins.c`, `lineardeltakins-common.h`, `rotarydeltakins.c`, `rotarydeltakins-common.h`, `scorbot-kins.c`, `tripodkins.c`, `scarakins.c`, `pumakins.c`, `pumakins.h`, `genhexkins.c`, `genhexkins.h`, `genserfuncs.c`, `genserkins.c`, `genserkins.h`, `ugenserkins.c`, `pentakins.c`, `pentakins.h`, `cubic.c` | Copy unchanged | HAL pin allocation, HAL parameter allocation, HAL component lifecycle, RTAPI module metadata, Go math C/C++ linkage, switchkins iterative-forward warmup, and userspace test-program process entry remain standalone runtime edges; forward/inverse behavior remains LinuxCNC source where the module exposes it | Vendor byte sync, per-file source probes, `linuxcnc_corexy_kinematics_probe`, `linuxcnc_rotate_kinematics_probe`, `linuxcnc_rose_kinematics_probe`, `linuxcnc_max_kinematics_probe`, `linuxcnc_lineardelta_kinematics_probe`, `linuxcnc_rotarydelta_kinematics_probe`, `linuxcnc_scorbot_kinematics_probe`, `linuxcnc_tripod_kinematics_probe`, `linuxcnc_scara_kinematics_probe`, `linuxcnc_puma_kinematics_probe`, `linuxcnc_genser_kinematics_probe`, `linuxcnc_genhex_kinematics_probe`, `linuxcnc_pentakins_kinematics_probe` |
| Trajectory planner | `src/emc/tp/tp.c`, `tc.c`, `tcq.c`, `spherical_arc.c`, `blendmath.c`, `sp_scurve.c`, `ruckig_wrapper.c`, plus matching `*.h` files | Copy unchanged | Native realtime scheduling and motion process state are replaced by standalone probe setup; the WASM TP probe uses the same deterministic status/config boundary and calls vendored TP APIs through a narrow C ABI | Vendor byte sync, per-file source probes, `linuxcnc_tp_api_probe`, `tests/wasm/node/verify_tp_wasm.sh` |
| Ruckig C planner support | Selected `src/emc/tp/cruckig/*.c` and `*.h` files in the manifest | Copy unchanged | Used as LinuxCNC planner support code through vendored TP sources | Vendor byte sync, per-file source probes, `tests/wasm/node/verify_tp_wasm.sh` |

View File

@@ -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",

View File

@@ -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"

View File

@@ -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",

View File

@@ -18,6 +18,10 @@ SUBS_FOLLOW_MAIN_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/subs-follow-mai
FRACTIONAL_LINENUMBERS_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/fractional-linenumbers/test.ngc"
NAMEDPARAM_BUG424_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/namedparam-bug424/test.ngc"
FLOWSNAKE_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/flowsnake/flowsnake.ngc"
BAD_NESTED_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/bad/nested.ngc"
BAD_NO_FEED_RATE_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/bad/no-feed-rate.ngc"
BAD_NO_IJR_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/bad/no-ijr.ngc"
BAD_PROBE_NO_AXES_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/bad/probe-no-axes.ngc"
G33_1_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/g33.1/g33.1.ngc"
G6164_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/g6164/test.ngc"
ROTATION_ABS_PTS_FIXTURE="$ROOT_DIR/vendor/linuxcnc/tests/interp/rotation/abs-pts/test.ngc"
@@ -1470,6 +1474,10 @@ run_interp_minimal_fixture subs_follow_main "$SUBS_FOLLOW_MAIN_FIXTURE"
run_interp_minimal_fixture fractional_linenumbers "$FRACTIONAL_LINENUMBERS_FIXTURE"
run_interp_minimal_fixture namedparam_bug424 "$NAMEDPARAM_BUG424_FIXTURE"
run_interp_minimal_fixture flowsnake "$FLOWSNAKE_FIXTURE"
run_interp_minimal_fixture bad_nested "$BAD_NESTED_FIXTURE"
run_interp_minimal_fixture bad_no_feed_rate "$BAD_NO_FEED_RATE_FIXTURE"
run_interp_minimal_fixture bad_no_ijr "$BAD_NO_IJR_FIXTURE"
run_interp_minimal_fixture bad_probe_no_axes "$BAD_PROBE_NO_AXES_FIXTURE"
run_interp_minimal_fixture g33_1 "$G33_1_FIXTURE"
run_interp_minimal_fixture g6164 "$G6164_FIXTURE"
run_interp_minimal_fixture rotation_abs_pts "$ROTATION_ABS_PTS_FIXTURE"

View File

@@ -284,6 +284,10 @@ tests/interp/flowsnake/README
tests/interp/flowsnake/expected
tests/interp/flowsnake/flowsnake.ngc
tests/interp/flowsnake/test.sh
tests/interp/bad/nested.ngc
tests/interp/bad/no-feed-rate.ngc
tests/interp/bad/no-ijr.ngc
tests/interp/bad/probe-no-axes.ngc
tests/interp/g33.1/expected
tests/interp/g33.1/g33.1.ngc
tests/interp/g33.1/test.sh

View File

@@ -0,0 +1,14 @@
;Nested subroutine definition
O1 sub
G1 X0
O2 sub
G1 Y0
O2 endsub
O1 endsub
O1 call
M30
%

View File

@@ -0,0 +1,2 @@
;Cannot do g1 with zero feed rate
g1x1

View File

@@ -0,0 +1,2 @@
;R i j k words all missing for arc
g2f1x1

View File

@@ -0,0 +1,2 @@
;All axes missing with motion code
g38.2 f1