Compare commits

...

7 Commits

5 changed files with 133 additions and 30 deletions

View File

@@ -899,6 +899,57 @@ if [[ -n "$manifest" && "$require_complete" == "--require-kinematics-complete" ]
fi
}
extract_waited_loadusr_programs() {
# Source basis: LinuxCNC src/hal/utils/halcmd_commands.cc
# do_loadusr_cmd() parses loadusr options with getopt("+wWin:"),
# and its help text plus src/hal/utils/halcmd_completion.c list both
# "-W" and "-Wn" wait forms.
awk '
function emit_waited_program(fields, field_count, start_index, i, token, waiting) {
waiting = 0
for (i = start_index + 1; i <= field_count; i++) {
token = fields[i]
if (token == "-W") {
waiting = 1
continue
}
if (token == "-Wn") {
waiting = 1
i++
continue
}
if (token == "-n") {
i++
continue
}
if (token ~ /^-Wn.+/) {
waiting = 1
continue
}
if (token ~ /^-n.+/) continue
if (token ~ /^-[wWi]+$/) {
if (token ~ /W/) waiting = 1
continue
}
if (token ~ /^-/) continue
if (waiting && token != "") print token
return
}
}
{
line = $0
sub(/[[:space:]]*[#;].*$/, "", line)
field_count = split(line, fields, /[[:space:]]+/)
for (i = 1; i <= field_count; i++) {
if (fields[i] == "loadusr") {
emit_waited_program(fields, field_count, i)
next
}
}
}
' "$1"
}
m428_m430_vismach_loadusr_sources=()
for source in "${manifest_m428_m430_ini_sources[@]}"; do
while IFS= read -r command_name; do
@@ -906,20 +957,7 @@ if [[ -n "$manifest" && "$require_complete" == "--require-kinematics-complete" ]
while IFS= read -r vismach_source; do
[[ -n "$vismach_source" ]] && m428_m430_vismach_loadusr_sources+=("$vismach_source")
done < <(resolve_vismach_loadusr_source "$command_name")
done < <(
awk '
BEGIN { IGNORECASE = 1 }
/^[[:space:]]*HALCMD[[:space:]]*=/ && /loadusr[[:space:]]/ {
for (i = 1; i <= NF; i++) {
if ($i == "-W" && (i + 1) <= NF) {
value = $(i + 1)
sub(/[[:space:]#;].*/, "", value)
if (value != "") print value
}
}
}
' "$linuxcnc_root/$source"
)
done < <(extract_waited_loadusr_programs "$linuxcnc_root/$source")
done
for source in "${m428_m430_config_hal_sources[@]}"; do
while IFS= read -r command_name; do
@@ -927,19 +965,7 @@ if [[ -n "$manifest" && "$require_complete" == "--require-kinematics-complete" ]
while IFS= read -r vismach_source; do
[[ -n "$vismach_source" ]] && m428_m430_vismach_loadusr_sources+=("$vismach_source")
done < <(resolve_vismach_loadusr_source "$command_name")
done < <(
awk '
/^[[:space:]]*loadusr[[:space:]]/ {
for (i = 1; i <= NF; i++) {
if ($i == "-W" && (i + 1) <= NF) {
value = $(i + 1)
sub(/[[:space:]#;].*/, "", value)
if (value != "") print value
}
}
}
' "$linuxcnc_root/$source"
)
done < <(extract_waited_loadusr_programs "$linuxcnc_root/$source")
done
mapfile -t m428_m430_vismach_loadusr_sources < <(
printf '%s\n' "${m428_m430_vismach_loadusr_sources[@]}" | sed '/^$/d' | sort -u

View File

@@ -220,6 +220,10 @@ This matrix tracks LinuxCNC feature coverage for the web/WASM simulator. A featu
| Parameter expressions and operators | covered for parameter references, native/source bracketed word-value whitespace, `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_word_bracket_whitespace.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 | LinuxCNC native/source 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 | LinuxCNC native/source `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 | LinuxCNC native/source errors covered for repeated `$`, block-delete execution skipping, unused `D/$/E/H/I/J/K/L/P/Q/R` words, bad item-start characters, middle-of-line or comment-prefixed `N` words, comment-prefixed or midline `O` words, top-level or midline bracket items, naked top-level numbers, non-leading ATAN argument slashes, malformed leading `N` numbers, EOF/program-end file checks, overlong file lines, too many M-codes, fractional/extended N-word sequence numbers, `close_and_downcase()` case/whitespace normalization, and percent-file termination from `interp_read.cc`, `interp_internal.cc`, `rs274ngc_pre.cc`, `interp_array.cc`, and `interp_check.cc` | `tests/gcode/linuxcnc_block_delete.ngc`, `tests/gcode/linuxcnc_multiple_spindle_choice_words_error.ngc`, `tests/gcode/linuxcnc_d_word_no_use_error.ngc`, `tests/gcode/linuxcnc_spindle_dollar_no_use_error.ngc`, `tests/gcode/linuxcnc_e_word_no_use_error.ngc`, `tests/gcode/linuxcnc_h_word_no_use_error.ngc`, `tests/gcode/linuxcnc_i_word_no_use_error.ngc`, `tests/gcode/linuxcnc_j_word_no_use_error.ngc`, `tests/gcode/linuxcnc_k_word_no_use_error.ngc`, `tests/gcode/linuxcnc_l_word_no_use_error.ngc`, `tests/gcode/linuxcnc_p_word_no_use_error.ngc`, `tests/gcode/linuxcnc_q_word_no_use_error.ngc`, `tests/gcode/linuxcnc_r_word_no_use_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_spaced_n_word_error.ngc`, `tests/gcode/linuxcnc_comment_prefixed_oword_error.ngc`, `tests/gcode/linuxcnc_midline_numeric_oword_error.ngc`, `tests/gcode/linuxcnc_midline_named_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_top_level_bare_atan_error.ngc`, `tests/gcode/linuxcnc_midline_bare_atan_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`, `tests/gcode/linuxcnc_fractional_linenumbers.ngc`, `tests/gcode/linuxcnc_extended_linenumbers.ngc`, `tests/gcode/linuxcnc_close_and_downcase_words.ngc`, `tests/gcode/linuxcnc_percent_file_ignores_trailing.ngc` |
| Block/item reader validation | LinuxCNC native/source errors covered for repeated `$`, block-delete execution skipping, unused `D/$/E/H/I/J/K/L/P/Q/R` words, bad item-start characters, middle-of-line or comment-prefixed `N` words, comment-prefixed or midline `O` words, top-level or midline bracket items, naked top-level numbers, non-leading ATAN argument slashes, malformed leading `N` numbers, EOF/program-end file checks, unclosed/nested parenthesis comments, commented or mid-program `%` characters, overlong file lines, too many M-codes, fractional/extended N-word sequence numbers, `close_and_downcase()` case/whitespace normalization, and percent-file termination from `interp_read.cc`, `interp_internal.cc`, `rs274ngc_pre.cc`, `interp_array.cc`, and `interp_check.cc` | `tests/gcode/linuxcnc_block_delete.ngc`, `tests/gcode/linuxcnc_multiple_spindle_choice_words_error.ngc`, `tests/gcode/linuxcnc_d_word_no_use_error.ngc`, `tests/gcode/linuxcnc_spindle_dollar_no_use_error.ngc`, `tests/gcode/linuxcnc_e_word_no_use_error.ngc`, `tests/gcode/linuxcnc_h_word_no_use_error.ngc`, `tests/gcode/linuxcnc_i_word_no_use_error.ngc`, `tests/gcode/linuxcnc_j_word_no_use_error.ngc`, `tests/gcode/linuxcnc_k_word_no_use_error.ngc`, `tests/gcode/linuxcnc_l_word_no_use_error.ngc`, `tests/gcode/linuxcnc_p_word_no_use_error.ngc`, `tests/gcode/linuxcnc_q_word_no_use_error.ngc`, `tests/gcode/linuxcnc_r_word_no_use_error.ngc`, `tests/gcode/linuxcnc_bad_character_bang_error.ngc`, `tests/gcode/linuxcnc_commented_percent_error.ngc`, `tests/gcode/linuxcnc_mid_program_percent_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_spaced_n_word_error.ngc`, `tests/gcode/linuxcnc_comment_prefixed_oword_error.ngc`, `tests/gcode/linuxcnc_midline_numeric_oword_error.ngc`, `tests/gcode/linuxcnc_midline_named_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_top_level_bare_atan_error.ngc`, `tests/gcode/linuxcnc_midline_bare_atan_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`, `tests/gcode/linuxcnc_unclosed_comment_error.ngc`, `tests/gcode/linuxcnc_nested_comment_error.ngc`, generated `linuxcnc_command_too_long_error.ngc`, `tests/gcode/linuxcnc_too_many_m_codes_error.ngc`, `tests/gcode/linuxcnc_fractional_linenumbers.ngc`, `tests/gcode/linuxcnc_extended_linenumbers.ngc`, `tests/gcode/linuxcnc_close_and_downcase_words.ngc`, `tests/gcode/linuxcnc_percent_file_ignores_trailing.ngc` |
| Broader canned cycles `G73`, `G74`, `G82`-`G89` | covered for representative LinuxCNC native/source `G73`, `G74`, `G82`, `G83`, `G84`, `G85`, `G86`, `G87`, `G88`, and `G89` sequences from `interp_cycles.cc`, including peck drilling, feed-out boring, stop/restart boring, dwell/feed-out boring, special non-XY `G74/G84` tapping argument order, and `G87` plane-specific `I/J/K` mapping; smoke parser still maps supported cycles across `G17/G18/G19` | `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` |
## Fixture Coverage Audit
The following LinuxCNC fixtures are also covered by both the native `librs274` runner and the source-link runner. They remain listed here so fixture coverage cannot drift out of the porting matrix: `tests/gcode/linuxcnc_abort_hot_comment.ngc`, `tests/gcode/linuxcnc_comments.ngc`, `tests/gcode/linuxcnc_g10_invalid_l_error.ngc`, `tests/gcode/linuxcnc_g10_l10_p_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g10_l11_p_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g10_l1_missing_tool_error.ngc`, `tests/gcode/linuxcnc_g10_l1_p_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g10_l1_q_negative_error.ngc`, `tests/gcode/linuxcnc_g10_l1_q_noninteger_error.ngc`, `tests/gcode/linuxcnc_g10_l1_q_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g10_l1_without_offsets_error.ngc`, `tests/gcode/linuxcnc_g10_l20_i_word_error.ngc`, `tests/gcode/linuxcnc_g10_l20_p_missing_error.ngc`, `tests/gcode/linuxcnc_g10_l20_p_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g10_l20_r_word_error.ngc`, `tests/gcode/linuxcnc_g10_l2_i_word_error.ngc`, `tests/gcode/linuxcnc_g10_l2_p_missing_error.ngc`, `tests/gcode/linuxcnc_g10_l2_p_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g10_p_non_integer_error.ngc`, `tests/gcode/linuxcnc_g4_arc_p_conflict_error.ngc`, `tests/gcode/linuxcnc_g52_missing_subsequent_weight_error.ngc`, `tests/gcode/linuxcnc_g52_missing_y_control_point_error.ngc`, `tests/gcode/linuxcnc_g52_noninteger_l_error.ngc`, `tests/gcode/linuxcnc_g52_nonpositive_p_error.ngc`, `tests/gcode/linuxcnc_g52_p_without_xy_after_start_error.ngc`, `tests/gcode/linuxcnc_g52_zero_feed_error.ngc`, `tests/gcode/linuxcnc_g53_after_intervening_motion_error.ngc`, `tests/gcode/linuxcnc_g53_short_control_points_error.ngc`, `tests/gcode/linuxcnc_g53_without_g52_error.ngc`, `tests/gcode/linuxcnc_g62_k_non_integer_error.ngc`, `tests/gcode/linuxcnc_g62_missing_p_order_error.ngc`, `tests/gcode/linuxcnc_g62_missing_q_mode_error.ngc`, `tests/gcode/linuxcnc_g62_p_non_integer_error.ngc`, `tests/gcode/linuxcnc_g62_q_non_integer_error.ngc`, `tests/gcode/linuxcnc_g62_q_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g62_zero_feed_error.ngc`, `tests/gcode/linuxcnc_indexed_parameters.ngc`, `tests/gcode/linuxcnc_ini_named_parameter.ngc`, `tests/gcode/linuxcnc_modal_invalidate.ngc`, `tests/gcode/linuxcnc_named_parameter_exists.ngc`, `tests/gcode/linuxcnc_named_parameter_normalization.ngc`, `tests/gcode/linuxcnc_polar_g28_error.ngc`, `tests/gcode/linuxcnc_polar_g30_error.ngc`, `tests/gcode/linuxcnc_readonly_named_parameter_assign_error.ngc`, `tests/gcode/linuxcnc_same_modal_control_mode_error.ngc`, `tests/gcode/linuxcnc_same_modal_g10_g92_error.ngc`, `tests/gcode/linuxcnc_same_modal_g4_g53_error.ngc`, `tests/gcode/linuxcnc_same_modal_g52_g92_error.ngc`, `tests/gcode/linuxcnc_same_modal_g921_g922_error.ngc`, `tests/gcode/linuxcnc_same_modal_predefined_position_error.ngc`, `tests/gcode/linuxcnc_same_modal_probe_motion_error.ngc`, and `tests/gcode/linuxcnc_same_modal_threading_motion_error.ngc`.

View File

@@ -43,7 +43,6 @@ These are the first group to keep compiling while we peel away native-only depen
- `interp_remap.cc`
- `interp_setup.cc`
- `interp_write.cc`
- `inifile.cc`
- `modal_state.cc`
- `nurbs_additional_functions.cc`
- `rs274ngc_pre.cc`

View File

@@ -790,6 +790,75 @@ grep -F 'linuxcnc_unclosed_comment_error|Unclosed comment found' test-linuxcnc-s
grep -F 'linuxcnc_nested_comment_error|Nested comment found' test-linuxcnc-source-link.sh >/dev/null
grep -F 'linuxcnc_commented_percent_error|Bad character '\''%'\'' used' test-linuxcnc-source-link.sh >/dev/null
grep -F 'linuxcnc_mid_program_percent_error|Bad character '\''%'\'' used' test-linuxcnc-source-link.sh >/dev/null
grep -F 'linuxcnc_unclosed_comment_error|Unclosed comment found' test-linuxcnc-rs274-native.sh >/dev/null
grep -F 'linuxcnc_nested_comment_error|Nested comment found' test-linuxcnc-rs274-native.sh >/dev/null
grep -F 'linuxcnc_commented_percent_error|Bad character '\''%'\'' used' test-linuxcnc-rs274-native.sh >/dev/null
grep -F 'linuxcnc_mid_program_percent_error|Bad character '\''%'\'' used' test-linuxcnc-rs274-native.sh >/dev/null
python3 - <<'PY'
from pathlib import Path
fixtures = sorted(path.stem for path in Path("tests/gcode").glob("linuxcnc_*.ngc"))
for label, script in [
("native RS274", Path("test-linuxcnc-rs274-native.sh")),
("source-linked RS274", Path("test-linuxcnc-source-link.sh")),
]:
text = script.read_text(encoding="utf-8")
missing = [fixture for fixture in fixtures if fixture not in text]
if missing:
raise SystemExit(
f"{label} regression script no longer covers LinuxCNC fixtures: "
+ ", ".join(missing)
)
porting_doc = Path("docs/linuxcnc-porting.md").read_text(encoding="utf-8")
missing_doc = [f"tests/gcode/{fixture}.ngc" for fixture in fixtures if f"tests/gcode/{fixture}.ngc" not in porting_doc]
if missing_doc:
raise SystemExit(
"LinuxCNC fixture coverage is missing from docs/linuxcnc-porting.md: "
+ ", ".join(missing_doc)
)
source_map = Path("docs/linuxcnc-rs274-source-map.md").read_text(encoding="utf-8")
manifest_core = [
Path(line.split(":", 2)[1]).name
for line in Path("linuxcnc-rs274-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("core:")
]
manifest_bindings = [
Path(line.split(":", 2)[1]).name
for line in Path("linuxcnc-rs274-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("binding:")
]
source_map_core = []
source_map_bindings = []
in_core_section = False
in_binding_section = False
for line in source_map.splitlines():
if line == "### Interpreter core":
in_core_section = True
in_binding_section = False
continue
if line == "### Python binding modules":
in_core_section = False
in_binding_section = True
continue
if in_core_section and line.startswith("### "):
break
if in_binding_section and line.startswith("### "):
in_binding_section = False
if in_core_section and line.startswith("- `"):
source_map_core.append(line.split("`", 2)[1])
if in_binding_section and line.startswith("- `"):
source_map_bindings.append(line.split("`", 2)[1])
if source_map_core != manifest_core:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md interpreter core list no longer matches linuxcnc-rs274-source-files.txt core manifest"
)
if source_map_bindings != manifest_bindings:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md Python binding module list no longer matches linuxcnc-rs274-source-files.txt binding manifest"
)
PY
for script in \
test-native.sh \

View File

@@ -300,6 +300,8 @@ done
# numbers, and non-leading ATAN argument slashes.
bad_character_error_cases=(
"linuxcnc_bad_character_bang_error|Bad character '!' used"
"linuxcnc_commented_percent_error|Bad character '%' used"
"linuxcnc_mid_program_percent_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_spaced_n_word_error|Bad character 'n' used"
@@ -328,11 +330,14 @@ done
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc read_text()
# rejects EOF without the matching percent/program end and overlong file
# lines; read_n_number() rejects malformed N-line numbers through
# read_integer_unsigned().
# read_integer_unsigned(); src/emc/rs274ngc/interp_internal.cc
# close_and_downcase() rejects unclosed and nested parenthesis comments.
read_text_error_cases=(
"linuxcnc_file_ended_no_program_end_error|File ended with no percent sign"
"linuxcnc_file_ended_no_percent_error|File ended with no percent sign"
"linuxcnc_bad_n_number_format_error|Bad format unsigned integer"
"linuxcnc_unclosed_comment_error|Unclosed comment found"
"linuxcnc_nested_comment_error|Nested comment found"
)
for case in "${read_text_error_cases[@]}"; do
fixture=${case%%|*}