Harden LinuxCNC wasm and native probe workflows

This commit is contained in:
cnc
2026-05-26 17:00:58 +08:00
parent 86734622d7
commit ce2f3f3769
98 changed files with 7384 additions and 877 deletions

View File

@@ -1200,6 +1200,47 @@ int main() {
ok &= expect(saw_g52_restore, "expected LinuxCNC G52/G92 shared offset to restore with G92.3");
ok &= expect(saw_g52_end_line, "expected LinuxCNC G52 program end line number");
const char block_delete_program[] =
"G21 G90 G17 F100\n"
" /N10 G1 X5\n"
"G1 X2\n"
"M30\n";
const char block_delete_on_config[] = "{\"backend\":\"linuxcnc-rs274\",\"blockDelete\":true}";
events.clear();
ok &= expect(cnc_sim_load_config_json(sim, block_delete_on_config, sizeof(block_delete_on_config) - 1) == 0,
cnc_sim_last_error(sim));
ok &= expect(cnc_sim_parse_program(sim, block_delete_program, sizeof(block_delete_program) - 1) == 0,
cnc_sim_last_error(sim));
bool saw_block_delete_skipped_line = false;
bool saw_block_delete_followup_line = false;
for (const auto &event : events) {
saw_block_delete_skipped_line = saw_block_delete_skipped_line ||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
event.line == 2 &&
event.end.x == 5.0);
saw_block_delete_followup_line = saw_block_delete_followup_line ||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
event.line == 3 &&
event.end.x == 2.0);
}
ok &= expect(!saw_block_delete_skipped_line, "expected LinuxCNC block-delete line to be skipped");
ok &= expect(saw_block_delete_followup_line, "expected LinuxCNC block-delete followup line to execute");
const char block_delete_off_config[] = "{\"backend\":\"linuxcnc-rs274\",\"blockDelete\":false}";
events.clear();
ok &= expect(cnc_sim_load_config_json(sim, block_delete_off_config, sizeof(block_delete_off_config) - 1) == 0,
cnc_sim_last_error(sim));
ok &= expect(cnc_sim_parse_program(sim, block_delete_program, sizeof(block_delete_program) - 1) == 0,
cnc_sim_last_error(sim));
bool saw_block_delete_disabled_line = false;
for (const auto &event : events) {
saw_block_delete_disabled_line = saw_block_delete_disabled_line ||
(event.type == CNC_SIM_EVENT_LINEAR_FEED &&
event.line == 2 &&
event.end.x == 5.0);
}
ok &= expect(saw_block_delete_disabled_line, "expected LinuxCNC disabled block-delete line to execute");
cnc_sim_destroy(sim);
int abort_count = 0;

File diff suppressed because it is too large Load Diff