参考所有分组:补 close_and_downcase word source 覆盖,测试通过
This commit is contained in:
@@ -563,6 +563,7 @@ grep -F 'tests/gcode/linuxcnc_readonly_named_parameters.ngc' test-native.sh >/de
|
|||||||
grep -F 'read_n_number()' test-linuxcnc-source-link.sh >/dev/null
|
grep -F 'read_n_number()' test-linuxcnc-source-link.sh >/dev/null
|
||||||
grep -F 'tests/gcode/linuxcnc_fractional_linenumbers.ngc' test-linuxcnc-source-link.sh >/dev/null
|
grep -F 'tests/gcode/linuxcnc_fractional_linenumbers.ngc' test-linuxcnc-source-link.sh >/dev/null
|
||||||
grep -F 'tests/gcode/linuxcnc_extended_linenumbers.ngc' test-linuxcnc-source-link.sh >/dev/null
|
grep -F 'tests/gcode/linuxcnc_extended_linenumbers.ngc' test-linuxcnc-source-link.sh >/dev/null
|
||||||
|
grep -F 'tests/gcode/linuxcnc_close_and_downcase_words.ngc' test-linuxcnc-source-link.sh >/dev/null
|
||||||
|
|
||||||
for script in \
|
for script in \
|
||||||
test-native.sh \
|
test-native.sh \
|
||||||
|
|||||||
@@ -1495,6 +1495,12 @@ CNC_SIM_RS274_VAR="$var_file" \
|
|||||||
CNC_SIM_RS274_VAR="$var_file" \
|
CNC_SIM_RS274_VAR="$var_file" \
|
||||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_extended_linenumbers.ngc \
|
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_extended_linenumbers.ngc \
|
||||||
>"$output_dir/cnc_sim_linuxcnc_source_extended_linenumbers.json"
|
>"$output_dir/cnc_sim_linuxcnc_source_extended_linenumbers.json"
|
||||||
|
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc read_text()
|
||||||
|
# calls close_and_downcase() to downcase words and remove spaces/tabs outside
|
||||||
|
# comments before read_items() dispatches the words.
|
||||||
|
CNC_SIM_RS274_VAR="$var_file" \
|
||||||
|
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_close_and_downcase_words.ngc \
|
||||||
|
>"$output_dir/cnc_sim_linuxcnc_source_close_and_downcase_words.json"
|
||||||
|
|
||||||
CNC_SIM_RS274_SOURCE_OUTPUT_DIR="$output_dir" python3 - <<'PY'
|
CNC_SIM_RS274_SOURCE_OUTPUT_DIR="$output_dir" python3 - <<'PY'
|
||||||
import json
|
import json
|
||||||
@@ -1556,6 +1562,16 @@ if extended_spindle_states[:3] != [(1, 111), (2, 222), (3, 333)]:
|
|||||||
f"{extended_spindle_states!r}"
|
f"{extended_spindle_states!r}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
close_and_downcase_words = load("cnc_sim_linuxcnc_source_close_and_downcase_words.json")
|
||||||
|
if not any(
|
||||||
|
event["type"] == "linear-feed" and
|
||||||
|
event["line"] == 3 and
|
||||||
|
event["end"]["x"] == 3 and
|
||||||
|
event["end"]["y"] == 4
|
||||||
|
for event in close_and_downcase_words
|
||||||
|
):
|
||||||
|
raise SystemExit("missing source-linked close_and_downcase mixed-case spaced-word move")
|
||||||
|
|
||||||
block_delete_off = load("cnc_sim_linuxcnc_source_block_delete_off.json")
|
block_delete_off = load("cnc_sim_linuxcnc_source_block_delete_off.json")
|
||||||
if not any(
|
if not any(
|
||||||
event["type"] == "linear-feed" and event["line"] == 2 and event["end"]["x"] == 5
|
event["type"] == "linear-feed" and event["line"] == 2 and event["end"]["x"] == 5
|
||||||
@@ -3444,3 +3460,4 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_source_g52_xz_nurbs.json"
|
|||||||
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g62_xz_nurbs.json"
|
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g62_xz_nurbs.json"
|
||||||
echo "dumped $output_dir/cnc_sim_linuxcnc_source_fractional_linenumbers.json"
|
echo "dumped $output_dir/cnc_sim_linuxcnc_source_fractional_linenumbers.json"
|
||||||
echo "dumped $output_dir/cnc_sim_linuxcnc_source_extended_linenumbers.json"
|
echo "dumped $output_dir/cnc_sim_linuxcnc_source_extended_linenumbers.json"
|
||||||
|
echo "dumped $output_dir/cnc_sim_linuxcnc_source_close_and_downcase_words.json"
|
||||||
|
|||||||
4
tests/gcode/linuxcnc_close_and_downcase_words.ngc
Normal file
4
tests/gcode/linuxcnc_close_and_downcase_words.ngc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
G 21 G 90 G 17
|
||||||
|
F 100
|
||||||
|
g 1 x 3 y 4
|
||||||
|
M2
|
||||||
Reference in New Issue
Block a user