补齐 probe 转换错误覆盖
结论:基于 LinuxCNC interp_convert.cc convert_probe(),native/source-link 现在覆盖零进给、G95 feed-per-rev 和起点等于终点三类 G38 probe 失败分支。
This commit is contained in:
@@ -525,6 +525,25 @@ for case in "${threading_convert_error_cases[@]}"; do
|
||||
fi
|
||||
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_$fixture.err"
|
||||
done
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc convert_probe()
|
||||
# rejects zero feed, feed-per-revolution mode, and degenerate probe moves before
|
||||
# issuing STRAIGHT_PROBE().
|
||||
probe_convert_error_cases=(
|
||||
"linuxcnc_probe_zero_feed_error|Cannot probe with zero feed rate"
|
||||
"linuxcnc_probe_feed_per_rev_error|Cannot probe with feed per rev mode"
|
||||
"linuxcnc_probe_start_too_close_error|Start point too close to probe point"
|
||||
)
|
||||
for case in "${probe_convert_error_cases[@]}"; do
|
||||
fixture=${case%%|*}
|
||||
expected=${case#*|}
|
||||
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_dump" "tests/gcode/$fixture.ngc" \
|
||||
>"$output_dir/cnc_sim_linuxcnc_$fixture.json" 2>"$output_dir/cnc_sim_linuxcnc_$fixture.err"; then
|
||||
echo "expected $fixture.ngc to fail" >&2
|
||||
exit 1
|
||||
fi
|
||||
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_$fixture.err"
|
||||
done
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_threading_sync.ngc >"$output_dir/cnc_sim_linuxcnc_threading_sync.json"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_threading_cycle.ngc >"$output_dir/cnc_sim_linuxcnc_threading_cycle.json"
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc
|
||||
|
||||
@@ -1182,6 +1182,25 @@ for case in "${threading_convert_error_cases[@]}"; do
|
||||
fi
|
||||
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
|
||||
done
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc convert_probe()
|
||||
# rejects zero feed, feed-per-revolution mode, and degenerate probe moves before
|
||||
# issuing STRAIGHT_PROBE().
|
||||
probe_convert_error_cases=(
|
||||
"linuxcnc_probe_zero_feed_error|Cannot probe with zero feed rate"
|
||||
"linuxcnc_probe_feed_per_rev_error|Cannot probe with feed per rev mode"
|
||||
"linuxcnc_probe_start_too_close_error|Start point too close to probe point"
|
||||
)
|
||||
for case in "${probe_convert_error_cases[@]}"; do
|
||||
fixture=${case%%|*}
|
||||
expected=${case#*|}
|
||||
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" "tests/gcode/$fixture.ngc" \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_$fixture.json" 2>"$output_dir/cnc_sim_linuxcnc_source_$fixture.err"; then
|
||||
echo "expected $fixture.ngc to fail" >&2
|
||||
exit 1
|
||||
fi
|
||||
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
|
||||
done
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
|
||||
# read_items() only consumes a leading N word before item dispatch;
|
||||
# read_one_item() then uses the default reader table from interp_array.cc
|
||||
|
||||
4
tests/gcode/linuxcnc_probe_feed_per_rev_error.ngc
Normal file
4
tests/gcode/linuxcnc_probe_feed_per_rev_error.ngc
Normal file
@@ -0,0 +1,4 @@
|
||||
G21 G90 G17
|
||||
G95
|
||||
F1
|
||||
G38.2 Z1
|
||||
4
tests/gcode/linuxcnc_probe_start_too_close_error.ngc
Normal file
4
tests/gcode/linuxcnc_probe_start_too_close_error.ngc
Normal file
@@ -0,0 +1,4 @@
|
||||
G21 G90 G17
|
||||
G0 Z0
|
||||
F100
|
||||
G38.2 Z0
|
||||
2
tests/gcode/linuxcnc_probe_zero_feed_error.ngc
Normal file
2
tests/gcode/linuxcnc_probe_zero_feed_error.ngc
Normal file
@@ -0,0 +1,2 @@
|
||||
G21 G90 G17
|
||||
G38.2 Z1
|
||||
Reference in New Issue
Block a user