From 49c2581292bac8afeb0a827ee74b8e442a5f0136 Mon Sep 17 00:00:00 2001 From: cnc Date: Fri, 22 May 2026 17:28:10 +0800 Subject: [PATCH] Cover probe moves in source link tests --- docs/linuxcnc-porting.md | 1 + test-linuxcnc-source-link.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/linuxcnc-porting.md b/docs/linuxcnc-porting.md index a1bea07..d553081 100644 --- a/docs/linuxcnc-porting.md +++ b/docs/linuxcnc-porting.md @@ -194,6 +194,7 @@ This matrix tracks LinuxCNC feature coverage for the web/WASM simulator. A featu | Canned cycle `G81/G80` | covered for drilling expand-to-canon path | `tests/gcode/linuxcnc_canned_cycle.ngc` | | Coordinate offset Canon events `G10 L2`, `G10 L20`, `G92/G92.1` | covered through LinuxCNC native/source backends | `tests/gcode/linuxcnc_coordinate_offsets.ngc`, `tests/gcode/linuxcnc_coordinate_l20.ngc` | | Cutter compensation | covered for tool-table `G41/G42 D...` and explicit-radius `G41.1/G42.1/G40` through LinuxCNC native/source backends | `tests/gcode/linuxcnc_cutter_comp.ngc` | +| Probe move `G38.3` | covered as a distinct probe event through LinuxCNC native/source backends | `tests/gcode/linuxcnc_probe_no_error.ngc` | | O-word subroutines and calls | covered for numeric `O... sub/call/return/endsub` through LinuxCNC file mode; smoke parser also covers named `O` sub/call/return/endsub | `tests/gcode/smoke_oword_subprogram.ngc` | | Broader canned cycles `G73`, `G82`-`G89` | partially covered: `G73`, `G82`, `G83`, `G85`, `G86`, `G89` | `tests/gcode/linuxcnc_canned_cycles_extended.ngc`, smoke API regression | | Full source-level wasm build | pending | replace Python/HAL/INI/tooldata support dependencies | diff --git a/test-linuxcnc-source-link.sh b/test-linuxcnc-source-link.sh index 9ee5e8b..9ead3c5 100755 --- a/test-linuxcnc-source-link.sh +++ b/test-linuxcnc-source-link.sh @@ -115,6 +115,9 @@ CNC_SIM_RS274_VAR="$var_file" \ CNC_SIM_RS274_VAR="$var_file" \ "$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_cutter_comp.ngc \ >/tmp/cnc_sim_linuxcnc_source_cutter_comp.json +CNC_SIM_RS274_VAR="$var_file" \ + "$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_probe_no_error.ngc \ + >/tmp/cnc_sim_linuxcnc_source_probe_no_error.json CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \ "$build_dir/linuxcnc_rs274_source_dump" tests/gcode/smoke_oword_subprogram.ngc \ >/tmp/cnc_sim_linuxcnc_source_oword_subprogram.json @@ -251,6 +254,19 @@ actual_cutter_comp = [ if actual_cutter_comp != expected_cutter_comp: raise SystemExit(f"unexpected source-linked cutter compensation path: {actual_cutter_comp!r}") +probe = json.loads(Path("/tmp/cnc_sim_linuxcnc_source_probe_no_error.json").read_text()) +if not any( + event["type"] == "probe" and + event["line"] == 4 and + event["feed"] == 100 and + event["start"]["z"] == 5 and + event["end"]["z"] == 0 + for event in probe +): + raise SystemExit("missing source-linked G38.3 probe event") +if any(event["type"] == "linear-feed" and event["line"] == 4 for event in probe): + raise SystemExit("source-linked G38.3 probe should not be emitted as linear-feed") + oword = json.loads(Path("/tmp/cnc_sim_linuxcnc_source_oword_subprogram.json").read_text()) if not any( event["type"] == "linear-feed" and @@ -324,6 +340,7 @@ echo "dumped /tmp/cnc_sim_linuxcnc_source_tool_length.json" echo "dumped /tmp/cnc_sim_linuxcnc_source_canned_cycle.json" echo "dumped /tmp/cnc_sim_linuxcnc_source_canned_cycles_extended.json" echo "dumped /tmp/cnc_sim_linuxcnc_source_cutter_comp.json" +echo "dumped /tmp/cnc_sim_linuxcnc_source_probe_no_error.json" echo "dumped /tmp/cnc_sim_linuxcnc_source_oword_subprogram.json" echo "dumped /tmp/cnc_sim_linuxcnc_source_coordinate_offsets.json" echo "dumped /tmp/cnc_sim_linuxcnc_source_coordinate_l20.json"