Cover probe moves in source link tests

This commit is contained in:
cnc
2026-05-22 17:28:10 +08:00
parent ea2c9c2ba9
commit 49c2581292
2 changed files with 18 additions and 0 deletions

View File

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