继续按 align-linuxcnc 约束:补 unary 错误源码回归

This commit is contained in:
cnc
2026-06-02 16:01:55 +08:00
parent dd4c62fce6
commit 3f5c3faf25
4 changed files with 24 additions and 1 deletions

View File

@@ -212,6 +212,6 @@ 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; 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` |
| Parameter expressions and operators | covered for parameter references, source-linked `mod`, `**`, logical, and relational operator precedence, plus LinuxCNC divide-by-zero, negative-power, and malformed `ATAN[]/[]` error paths from `interp_read.cc`/`interp_execute.cc` | `tests/gcode/linuxcnc_parameter_expression_assignment.ngc`, `tests/gcode/linuxcnc_expression_operators.ngc`, `tests/gcode/linuxcnc_divide_by_zero_error.ngc`, `tests/gcode/linuxcnc_negative_power_error.ngc`, `tests/gcode/linuxcnc_atan_missing_slash_error.ngc`, `tests/gcode/linuxcnc_atan_missing_bracket_error.ngc` |
| Parameter expressions and operators | covered for parameter references, source-linked `mod`, `**`, logical, and relational operator precedence, plus LinuxCNC divide-by-zero, negative-power, malformed `ATAN[]/[]`, and unary operation error paths from `interp_read.cc`/`interp_execute.cc` | `tests/gcode/linuxcnc_parameter_expression_assignment.ngc`, `tests/gcode/linuxcnc_expression_operators.ngc`, `tests/gcode/linuxcnc_divide_by_zero_error.ngc`, `tests/gcode/linuxcnc_negative_power_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` |
| 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

@@ -608,6 +608,25 @@ if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
fi
grep -q "Left bracket missing after slash with atan" \
"$output_dir/cnc_sim_linuxcnc_source_atan_missing_bracket_error.err"
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc
# read_operation_unary() selects known unary operations, and read_unary()
# requires the operation name to be followed by a left bracket.
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_unary_missing_bracket_error.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_unary_missing_bracket_error.json" 2>"$output_dir/cnc_sim_linuxcnc_source_unary_missing_bracket_error.err"; then
echo "expected linuxcnc_unary_missing_bracket_error.ngc to fail" >&2
exit 1
fi
grep -q "Left bracket missing after unary operation name" \
"$output_dir/cnc_sim_linuxcnc_source_unary_missing_bracket_error.err"
if CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_unary_unknown_word_error.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_unary_unknown_word_error.json" 2>"$output_dir/cnc_sim_linuxcnc_source_unary_unknown_word_error.err"; then
echo "expected linuxcnc_unary_unknown_word_error.ngc to fail" >&2
exit 1
fi
grep -q "Unknown word starting with a" \
"$output_dir/cnc_sim_linuxcnc_source_unary_unknown_word_error.err"
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_value_returned.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_value_returned.json"

View File

@@ -0,0 +1,2 @@
#1 = SIN 1
G1 X#1 F100

View File

@@ -0,0 +1,2 @@
#1 = ABQ[1]
G1 X#1 F100