feat(xce-test-cli-ux): add process-level help/version discovery
argp already provided --help/-?/--version with exit-without-REPL behavior, but had no -h alias (its default short help flag is -? per GNU argp convention) despite Requirement 4.1 naming -h explicitly. Added a hidden -h option triggering the same help path, and extended the doc string to describe the in-session help command. Proven against the real compiled binary via subprocess tests, not just argp's own in-process behavior. 1289/1289 controller suite passing (+4). Task 1.6 of .kiro/specs/xce-test-cli-ux/tasks.md. Requirements: 4.1, 4.2, 4.3 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019jaMf9QEwpugH2W9KAuc7f
This commit is contained in:
parent
204f81d134
commit
b70228c558
5 changed files with 270 additions and 2 deletions
|
|
@ -39,7 +39,7 @@
|
|||
- _Boundary: Interruptible Call Adapter_
|
||||
- _Depends: 1.4_
|
||||
|
||||
- [ ] 1.6 Add process-level help and version discovery
|
||||
- [x] 1.6 Add process-level help and version discovery
|
||||
- Ensure invoking the process with a help or version flag prints the appropriate output and exits without starting the interactive/scripted session
|
||||
- Extend the process-level help output to describe the in-session help command as the way to list and learn available commands
|
||||
- Observable completion: invoking the process with the help flag prints usage text mentioning the in-session help command, and invoking with the version flag prints version information, both without entering the REPL
|
||||
|
|
@ -178,6 +178,7 @@
|
|||
## Implementation Notes
|
||||
- `src/tools/xce-build.sh controller asan xce.build --incremental` writes its build dir at `src/xce.build/` (relative to the script's own location), not a repo-root `xce.build/` — meson logs are at `src/xce.build/meson-logs/testlog.txt`. (task 1.1)
|
||||
- New Unity test files need two wiring points, not just meson.build's source list: also register an `extern void test_<module>(void);` + `TEST(test_<module>);` in `src/controller/testsuite/controller_test.c`, mirroring the existing `test_rcfile` registration, or the suite silently never runs. (task 1.1)
|
||||
- `argp` has no built-in `-h` alias (its default short help flag is `-?`) — Requirement 4.1 literally names `-h`, so it needed an explicit `OPTION_HIDDEN` option added, not just verification of existing defaults. Task 1.6's new `test_xcetest_process_entry.c` already covers "`-h`/`--help`/`--version` exit without entering the REPL" end-to-end against the real binary; task 1.7's `test_test_cli.c` should either skip re-adding this exact scenario or consolidate the two rather than duplicating coverage. (task 1.6)
|
||||
- The per-connection lock is a POSIX semaphore (`sem_t`), not a `pthread_mutex_t` — a mutex was tried first but rejected on review (POSIX classifies a non-owning-thread `pthread_mutex_unlock()` as UB for every mutex type, not just error-checking ones, and this design needs the worker thread to release a lock the caller thread acquired). `sem_t` has no ownership concept and is fully POSIX-defined for this pattern. See bug-1791. (task 1.5)
|
||||
- `interruptcall.c`'s forced-abandonment test proves `-EINTR` via return-value disambiguation against a slow `fn`, not a direct wall-clock elapsed-time assertion — sound today (poll interval is 50ms, matching design.md) but a future regression widening the poll interval wouldn't be caught unless the test also asserts an elapsed-time bound. Non-blocking; noted for task 4.1's end-to-end Ctrl-C validation to consider. (task 1.4)
|
||||
- After task 1.3's SIGINT/EINTR fix alone (before task 3.2 wires the REPL loop to check `xcetest_interrupted()`), a real Ctrl-C at `xce_test`'s top-level interactive prompt now causes the process to EXIT (readline's EINTR-driven NULL return is currently treated the same as EOF) rather than gracefully redisplaying the prompt. This is expected/deferred, not a regression — no current test exercises that path — but task 3.2's implementer must fix it as part of wiring the REPL loop, not just the RPC call sites. (task 1.3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue