继续按 align-linuxcnc 约束:补螺纹和恒线速校验源码覆盖,测试通过
This commit is contained in:
@@ -832,6 +832,31 @@ for case in "${unused_word_error_cases[@]}"; do
|
||||
fi
|
||||
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
|
||||
done
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_check.cc
|
||||
# check_other_codes() enforces required and disallowed words for G96,
|
||||
# G33/G33.1, and G76 before motion conversion.
|
||||
threading_check_error_cases=(
|
||||
"linuxcnc_g96_missing_s_word_error|S word missing with G96"
|
||||
"linuxcnc_g33_missing_k_word_error|K word missing with g33/g33.1"
|
||||
"linuxcnc_g33_f_word_error|F word used with a g33/g33.1"
|
||||
"linuxcnc_g33_1_missing_k_word_error|K word missing with g33/g33.1"
|
||||
"linuxcnc_g33_1_f_word_error|F word used with a g33/g33.1"
|
||||
"linuxcnc_g76_missing_p_word_error|P word missing with G76"
|
||||
"linuxcnc_g76_missing_i_word_error|I J or K words missing with G76"
|
||||
"linuxcnc_g76_missing_j_word_error|I J or K words missing with G76"
|
||||
"linuxcnc_g76_missing_k_word_error|I J or K words missing with G76"
|
||||
)
|
||||
for case in "${threading_check_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
|
||||
|
||||
Reference in New Issue
Block a user