继续按 align-linuxcnc 约束:补 reader 裸项错误源码覆盖,测试通过

This commit is contained in:
cnc
2026-06-02 18:43:54 +08:00
parent 318220b766
commit 3435c3556a
12 changed files with 55 additions and 14 deletions

View File

@@ -212,9 +212,9 @@ This matrix tracks LinuxCNC feature coverage for the web/WASM simulator. A featu
| Cutter compensation | covered for tool-table `G41/G42 D...` and explicit-radius `G41.1/G42.1/G40` through LinuxCNC native/source backends | `tests/gcode/linuxcnc_cutter_comp.ngc` |
| Probe moves `G38.2/G38.3/G38.4/G38.5` | covered as distinct probe events with LinuxCNC `probe_type` preserved through smoke, native, and source-linked paths | `tests/gcode/linuxcnc_probe_no_error.ngc` |
| O-word subroutines, calls, and control flow | covered for numeric and named `O... sub/call/return/endsub` plus `if`/`elseif`/`else`, `while`, `repeat`, `do`/`while`, `break`, and `continue` through LinuxCNC file mode; source-linked read/execution errors cover malformed O-word commands, missing control-expression brackets, duplicate/undefined/unmatched labels, out-of-context `return`/`endsub`, wrong subroutine close style, too many or empty call parameters, too many nested call levels, Fanuc-style `M98` missing `P`, and comment-prefixed `M98` falling through to normal M-code handling; smoke parser also covers named `O<name>` sub/call/return/endsub and loop-control forms | `tests/gcode/smoke_oword_subprogram.ngc`, `tests/gcode/linuxcnc_named_oword_subprogram.ngc`, `tests/gcode/linuxcnc_oword_control_flow.ngc`, `tests/gcode/linuxcnc_oword_unknown_command_error.ngc`, `tests/gcode/linuxcnc_oword_unexpected_trailing_item_error.ngc`, `tests/gcode/linuxcnc_oword_if_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_oword_elseif_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_oword_while_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_oword_repeat_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_oword_too_many_call_parameters_error.ngc`, `tests/gcode/linuxcnc_oword_empty_call_parameter_error.ngc`, `tests/gcode/linuxcnc_oword_too_many_call_levels_error.ngc`, `tests/gcode/linuxcnc_oword_endsub_without_sub_error.ngc`, `tests/gcode/linuxcnc_oword_return_without_sub_error.ngc`, `tests/gcode/linuxcnc_oword_duplicate_if_label_error.ngc`, `tests/gcode/linuxcnc_oword_elseif_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_else_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_endif_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_break_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_continue_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_endwhile_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_elseif_no_matching_if_error.ngc`, `tests/gcode/linuxcnc_oword_break_no_matching_loop_error.ngc`, `tests/gcode/linuxcnc_oword_continue_no_matching_loop_error.ngc`, `tests/gcode/linuxcnc_oword_endrepeat_no_matching_repeat_error.ngc`, `tests/gcode/linuxcnc_oword_endif_no_matching_if_error.ngc`, `tests/gcode/linuxcnc_oword_endwhile_no_matching_while_error.ngc`, `tests/gcode/linuxcnc_oword_fanuc_requires_m99_error.ngc`, `tests/gcode/linuxcnc_oword_sub_requires_endsub_error.ngc`, `tests/gcode/linuxcnc_m98_missing_p_word_error.ngc`, `tests/gcode/linuxcnc_comment_prefixed_m98_error.ngc` |
| Parameter expressions and operators | covered for parameter references, source-linked `mod`, `**`, logical, and relational operator precedence, plus LinuxCNC parameter-setting syntax, parameter index validation, named-parameter termination, real-number parsing, divide-by-zero, negative sqrt/power, infinity rejection, malformed `ATAN[]/[]`, unary operation syntax, `read_operation_unary()` unknown-word branches, `read_operation()` binary-operation prefix, unknown operation, and unclosed-expression error paths from `interp_read.cc`/`interp_execute.cc` | `tests/gcode/linuxcnc_parameter_expression_assignment.ngc`, `tests/gcode/linuxcnc_parameter_missing_equal_error.ngc`, `tests/gcode/linuxcnc_parameter_missing_value_error.ngc`, `tests/gcode/linuxcnc_parameter_number_out_of_range_error.ngc`, `tests/gcode/linuxcnc_parameter_reference_out_of_range_error.ngc`, `tests/gcode/linuxcnc_non_integer_parameter_index_error.ngc`, `tests/gcode/linuxcnc_named_parameter_not_terminated_error.ngc`, `tests/gcode/linuxcnc_no_real_value_error.ngc`, `tests/gcode/linuxcnc_bad_number_format_error.ngc`, `tests/gcode/linuxcnc_expression_operators.ngc`, `tests/gcode/linuxcnc_negative_sqrt_error.ngc`, `tests/gcode/linuxcnc_divide_by_zero_error.ngc`, `tests/gcode/linuxcnc_negative_power_error.ngc`, `tests/gcode/linuxcnc_infinite_expression_error.ngc`, `tests/gcode/linuxcnc_atan_missing_slash_error.ngc`, `tests/gcode/linuxcnc_atan_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_unary_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_c_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_e_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_f_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_l_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_r_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_s_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_t_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_default_word_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_a_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_e_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_g_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_l_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_m_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_n_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_o_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_x_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_operation_error.ngc`, `tests/gcode/linuxcnc_unclosed_expression_error.ngc` |
| Parameter expressions and operators | covered for parameter references, source-linked `mod`, `**`, logical, and relational operator precedence, plus LinuxCNC parameter-setting syntax, parameter index validation, named-parameter termination, real-number parsing, divide-by-zero, negative sqrt/power, infinity rejection, malformed and bare `ATAN[]/[]`, unary operation syntax including bare unary items, `read_operation_unary()` unknown-word branches, `read_operation()` binary-operation prefix, unknown operation, and unclosed-expression error paths from `interp_read.cc`/`interp_execute.cc` | `tests/gcode/linuxcnc_parameter_expression_assignment.ngc`, `tests/gcode/linuxcnc_parameter_missing_equal_error.ngc`, `tests/gcode/linuxcnc_midline_parameter_missing_equal_error.ngc`, `tests/gcode/linuxcnc_parameter_missing_value_error.ngc`, `tests/gcode/linuxcnc_parameter_number_out_of_range_error.ngc`, `tests/gcode/linuxcnc_parameter_reference_out_of_range_error.ngc`, `tests/gcode/linuxcnc_non_integer_parameter_index_error.ngc`, `tests/gcode/linuxcnc_named_parameter_not_terminated_error.ngc`, `tests/gcode/linuxcnc_no_real_value_error.ngc`, `tests/gcode/linuxcnc_bad_number_format_error.ngc`, `tests/gcode/linuxcnc_expression_operators.ngc`, `tests/gcode/linuxcnc_negative_sqrt_error.ngc`, `tests/gcode/linuxcnc_divide_by_zero_error.ngc`, `tests/gcode/linuxcnc_negative_power_error.ngc`, `tests/gcode/linuxcnc_infinite_expression_error.ngc`, `tests/gcode/linuxcnc_atan_missing_slash_error.ngc`, `tests/gcode/linuxcnc_atan_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_top_level_bare_atan_error.ngc`, `tests/gcode/linuxcnc_midline_bare_atan_error.ngc`, `tests/gcode/linuxcnc_unary_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_c_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_e_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_f_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_l_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_r_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_s_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_t_word_error.ngc`, `tests/gcode/linuxcnc_unary_unknown_default_word_error.ngc`, `tests/gcode/linuxcnc_top_level_bare_unary_error.ngc`, `tests/gcode/linuxcnc_midline_bare_unary_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_a_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_e_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_g_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_l_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_m_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_n_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_o_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_x_operation_error.ngc`, `tests/gcode/linuxcnc_binary_unknown_operation_error.ngc`, `tests/gcode/linuxcnc_unclosed_expression_error.ngc` |
| Word reader validation | source-linked LinuxCNC reader errors covered for negative `F/G/H/L/M/S/T` values and repeated `A/B/C/D/E/F/H/I/J/K/L/P/Q/R/S/T/U/V/W/X/Y/Z` words from `interp_read.cc` | `tests/gcode/linuxcnc_negative_f_word_error.ngc`, `tests/gcode/linuxcnc_negative_g_code_error.ngc`, `tests/gcode/linuxcnc_negative_h_word_error.ngc`, `tests/gcode/linuxcnc_negative_l_word_error.ngc`, `tests/gcode/linuxcnc_negative_m_code_error.ngc`, `tests/gcode/linuxcnc_negative_s_word_error.ngc`, `tests/gcode/linuxcnc_negative_t_word_error.ngc`, `tests/gcode/linuxcnc_multiple_a_words_error.ngc`, `tests/gcode/linuxcnc_multiple_b_words_error.ngc`, `tests/gcode/linuxcnc_multiple_c_words_error.ngc`, `tests/gcode/linuxcnc_multiple_d_words_error.ngc`, `tests/gcode/linuxcnc_multiple_e_words_error.ngc`, `tests/gcode/linuxcnc_multiple_f_words_error.ngc`, `tests/gcode/linuxcnc_multiple_h_words_error.ngc`, `tests/gcode/linuxcnc_multiple_i_words_error.ngc`, `tests/gcode/linuxcnc_multiple_j_words_error.ngc`, `tests/gcode/linuxcnc_multiple_k_words_error.ngc`, `tests/gcode/linuxcnc_multiple_l_words_error.ngc`, `tests/gcode/linuxcnc_multiple_p_words_error.ngc`, `tests/gcode/linuxcnc_multiple_q_words_error.ngc`, `tests/gcode/linuxcnc_multiple_r_words_error.ngc`, `tests/gcode/linuxcnc_multiple_s_words_error.ngc`, `tests/gcode/linuxcnc_multiple_t_words_error.ngc`, `tests/gcode/linuxcnc_multiple_u_words_error.ngc`, `tests/gcode/linuxcnc_multiple_v_words_error.ngc`, `tests/gcode/linuxcnc_multiple_w_words_error.ngc`, `tests/gcode/linuxcnc_multiple_x_words_error.ngc`, `tests/gcode/linuxcnc_multiple_y_words_error.ngc`, `tests/gcode/linuxcnc_multiple_z_words_error.ngc` |
| G/M reader validation | source-linked LinuxCNC `read_g()`/`read_m()` errors covered for range checks, unknown code tables, and same-modal-group conflicts from `interp_read.cc` and `interp_array.cc` | `tests/gcode/linuxcnc_g_code_out_of_range_error.ngc`, `tests/gcode/linuxcnc_unknown_g_code_error.ngc`, `tests/gcode/linuxcnc_two_g_codes_same_modal_group_error.ngc`, `tests/gcode/linuxcnc_m_code_greater_199_error.ngc`, `tests/gcode/linuxcnc_unknown_m_code_error.ngc`, `tests/gcode/linuxcnc_two_m_codes_same_modal_group_error.ngc` |
| Block/item reader validation | source-linked LinuxCNC block reader errors covered for repeated `$`, bad item-start characters, middle-of-line or comment-prefixed `N` words, comment-prefixed `O` words, malformed leading `N` numbers, EOF/program-end file checks, overlong file lines, and too many M-codes from `interp_read.cc`, `interp_array.cc`, and `interp_check.cc` | `tests/gcode/linuxcnc_multiple_spindle_choice_words_error.ngc`, `tests/gcode/linuxcnc_bad_character_bang_error.ngc`, `tests/gcode/linuxcnc_bad_character_middle_n_word_error.ngc`, `tests/gcode/linuxcnc_comment_prefixed_n_word_error.ngc`, `tests/gcode/linuxcnc_comment_prefixed_oword_error.ngc`, `tests/gcode/linuxcnc_bad_n_number_format_error.ngc`, `tests/gcode/linuxcnc_file_ended_no_program_end_error.ngc`, `tests/gcode/linuxcnc_file_ended_no_percent_error.ngc`, generated `linuxcnc_command_too_long_error.ngc`, `tests/gcode/linuxcnc_too_many_m_codes_error.ngc` |
| Block/item reader validation | source-linked LinuxCNC block reader errors covered for repeated `$`, bad item-start characters, middle-of-line or comment-prefixed `N` words, comment-prefixed `O` words, top-level or midline bracket items, naked top-level numbers, malformed leading `N` numbers, EOF/program-end file checks, overlong file lines, and too many M-codes from `interp_read.cc`, `interp_array.cc`, and `interp_check.cc` | `tests/gcode/linuxcnc_multiple_spindle_choice_words_error.ngc`, `tests/gcode/linuxcnc_bad_character_bang_error.ngc`, `tests/gcode/linuxcnc_bad_character_middle_n_word_error.ngc`, `tests/gcode/linuxcnc_comment_prefixed_n_word_error.ngc`, `tests/gcode/linuxcnc_comment_prefixed_oword_error.ngc`, `tests/gcode/linuxcnc_bad_character_top_left_bracket_error.ngc`, `tests/gcode/linuxcnc_bad_character_top_right_bracket_error.ngc`, `tests/gcode/linuxcnc_bad_character_midline_left_bracket_error.ngc`, `tests/gcode/linuxcnc_bad_character_midline_right_bracket_error.ngc`, `tests/gcode/linuxcnc_bad_character_top_number_error.ngc`, `tests/gcode/linuxcnc_bad_n_number_format_error.ngc`, `tests/gcode/linuxcnc_file_ended_no_program_end_error.ngc`, `tests/gcode/linuxcnc_file_ended_no_percent_error.ngc`, generated `linuxcnc_command_too_long_error.ngc`, `tests/gcode/linuxcnc_too_many_m_codes_error.ngc` |
| Broader canned cycles `G73`, `G74`, `G82`-`G89` | partially covered: `G73`, `G74`, `G82`, `G83`, `G84`, `G85`, `G86`, `G87`, `G88`, `G89`; smoke parser maps supported cycles across `G17/G18/G19`, including LinuxCNC's special non-XY `G74/G84` tapping argument order and `G87` plane-specific `I/J/K` mapping; native/source regressions now check non-XY `G74/G84/G86/G87/G88` sequences | `tests/gcode/linuxcnc_canned_cycles_extended.ngc`, `tests/gcode/linuxcnc_canned_cycle_planes.ngc`, smoke API regression |
| Full source-level wasm build | covered for the current wasm-safe RS274 source set, with remaining work focused on broadening browser-hostile dependency replacement and feature coverage | `./build-wasm.sh`, `test-linuxcnc-wasm-runtime-link.sh`, `test-web-wasm-node-smoke.sh`, `test-web-wasm-browser-smoke.sh` |

View File

@@ -564,6 +564,7 @@ fi
# read_real_value() requires a real value after '='.
parameter_setting_error_cases=(
"linuxcnc_parameter_missing_equal_error|Equal sign missing in parameter setting"
"linuxcnc_midline_parameter_missing_equal_error|Equal sign missing in parameter setting"
"linuxcnc_parameter_missing_value_error|No characters found in reading real value"
)
for case in "${parameter_setting_error_cases[@]}"; do
@@ -575,7 +576,7 @@ for case in "${parameter_setting_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
# read_parameter(), read_parameter_setting(), read_integer_value(),
@@ -598,7 +599,7 @@ for case in "${parameter_reader_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_negative_sqrt_error.ngc \
@@ -670,6 +671,8 @@ unary_unknown_word_error_cases=(
"linuxcnc_unary_unknown_s_word_error|Unknown word starting with s"
"linuxcnc_unary_unknown_t_word_error|Unknown word starting with t"
"linuxcnc_unary_unknown_default_word_error|Unknown word where unary operation could be"
"linuxcnc_top_level_bare_unary_error|Unknown word where unary operation could be"
"linuxcnc_midline_bare_unary_error|Unknown word where unary operation could be"
)
for case in "${unary_unknown_word_error_cases[@]}"; do
fixture=${case%%|*}
@@ -680,7 +683,7 @@ for case in "${unary_unknown_word_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
# read_operation() rejects unknown binary operation names by prefix,
@@ -707,7 +710,7 @@ for case in "${binary_operation_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
# read_f()/read_g()/read_h()/read_l()/read_m()/read_s()/read_t()
@@ -730,7 +733,7 @@ for case in "${negative_word_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
# read_g()/read_m() validate numeric range, known code tables from
@@ -752,7 +755,7 @@ for case in "${gm_reader_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
# read_dollar() rejects repeated spindle-choice words while filling a block.
@@ -768,12 +771,20 @@ grep -Fq "Multiple spindle choice (\$) words on one line" \
# read_items() only consumes a leading N word before item dispatch;
# read_one_item() then uses the default reader table from interp_array.cc
# and rejects unknown item-start characters, including middle-of-line or
# comment-prefixed N/O words.
# comment-prefixed N/O words, bracket expressions, naked numbers, and
# non-leading ATAN argument slashes.
bad_character_error_cases=(
"linuxcnc_bad_character_bang_error|Bad character '!' used"
"linuxcnc_bad_character_middle_n_word_error|Bad character 'n' used"
"linuxcnc_comment_prefixed_n_word_error|Bad character 'n' used"
"linuxcnc_comment_prefixed_oword_error|Bad character 'o' used"
"linuxcnc_bad_character_top_left_bracket_error|Bad character '[' used"
"linuxcnc_bad_character_top_right_bracket_error|Bad character ']' used"
"linuxcnc_bad_character_midline_left_bracket_error|Bad character '[' used"
"linuxcnc_bad_character_midline_right_bracket_error|Bad character ']' used"
"linuxcnc_bad_character_top_number_error|Bad character '1' used"
"linuxcnc_top_level_bare_atan_error|Bad character '/' used"
"linuxcnc_midline_bare_atan_error|Bad character '/' used"
)
for case in "${bad_character_error_cases[@]}"; do
fixture=${case%%|*}
@@ -784,7 +795,7 @@ for case in "${bad_character_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_check.cc
# check_m_codes() rejects blocks with more than MAX_EMS M-codes.
@@ -832,7 +843,7 @@ for case in "${multiple_word_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_value_returned.ngc \
@@ -898,7 +909,7 @@ for case in "${oword_reader_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_o_word.cc
# convert_control_functions() rejects unmatched, duplicate, and
@@ -932,7 +943,7 @@ for case in "${oword_execution_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc read_text()
# rejects EOF without the matching percent/program end and overlong file
@@ -952,7 +963,7 @@ for case in "${read_text_error_cases[@]}"; do
echo "expected $fixture.ngc to fail" >&2
exit 1
fi
grep -q "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
grep -Fq "$expected" "$output_dir/cnc_sim_linuxcnc_source_$fixture.err"
done
long_line_fixture="$output_dir/linuxcnc_command_too_long_error.ngc"
printf 'G1 X' > "$long_line_fixture"

View File

@@ -0,0 +1,3 @@
G21 G90 F100
G1 X5 [1]
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
G1 X5 ]
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
[1] G1 X5
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
1 G1 X5
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
] G1 X5
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
G1 X5 ATAN[1]/[1]
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
G1 X5 ABS[1]
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
G1 X5 #1
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
ATAN[1]/[1]
M30

View File

@@ -0,0 +1,3 @@
G21 G90 F100
ABS[1]
M30