继续按 align-linuxcnc 约束:补增强块轴值错误源码覆盖,测试通过
This commit is contained in:
@@ -576,6 +576,29 @@ for case in "${polar_coordinate_error_cases[@]}"; do
|
||||
fi
|
||||
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
|
||||
done
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_internal.cc
|
||||
# enhance_block() assigns motion_to_be and rejects invalid axis use with G80,
|
||||
# missing axes for G52/G92 or motion codes, bare axis words without active
|
||||
# motion, and modal-0 G codes that consume axis values on a motion block.
|
||||
enhance_block_error_cases=(
|
||||
"linuxcnc_g80_axis_error|Cannot use axis values with g80"
|
||||
"linuxcnc_g52_missing_axis_error|All axes missing with g52 or g92"
|
||||
"linuxcnc_g92_missing_axis_error|All axes missing with g52 or g92"
|
||||
"linuxcnc_motion_missing_axis_error|All axes missing with motion code"
|
||||
"linuxcnc_axis_without_motion_error|Cannot use axis values without a g code that uses them"
|
||||
"linuxcnc_motion_with_g92_axis_error|Cannot use two g codes that both use axis values"
|
||||
)
|
||||
for case in "${enhance_block_error_cases[@]}"; do
|
||||
fixture=${case%%|*}
|
||||
expected=${case#*|}
|
||||
if 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
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_predefined_positions.ngc \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_predefined_positions.json"
|
||||
|
||||
Reference in New Issue
Block a user