继续按 align-linuxcnc 约束:补 GM 读码 native 覆盖,测试通过
This commit is contained in:
@@ -167,6 +167,28 @@ for case in "${check_g_code_error_cases[@]}"; do
|
||||
fi
|
||||
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_$fixture.err"
|
||||
done
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
|
||||
# read_g()/read_m() validate numeric range, known code tables from
|
||||
# interp_array.cc, and same-modal-group conflicts while filling a block.
|
||||
gm_reader_error_cases=(
|
||||
"linuxcnc_g_code_out_of_range_error|G-code out of range"
|
||||
"linuxcnc_unknown_g_code_error|Unknown g code used"
|
||||
"linuxcnc_two_g_codes_same_modal_group_error|Two g codes used from same modal group"
|
||||
"linuxcnc_m_code_greater_199_error|M-code greater than 199: M200"
|
||||
"linuxcnc_unknown_m_code_error|Unknown m code used: M13"
|
||||
"linuxcnc_two_m_codes_same_modal_group_error|Two m codes used from same modal group"
|
||||
)
|
||||
for case in "${gm_reader_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
|
||||
|
||||
Reference in New Issue
Block a user