test(relinker): cover CLI argument parsing #1856

Merged
sarohy03 merged 1 commit from upstream-pr/1856 into main 2026-10-09 09:41:25 +00:00
sarohy03 commented 2026-10-08 22:09:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by sarohy03 on 2026-10-08T22:09:42Z.


What

Cli::ParseArgs (core/relinker/cli/src/CliArgs.cpp) had no test coverage — the only test under cli/tests/ is AutorunExitTests, which exercises the autorun launcher rather than the parser. This adds cli_args_tests and registers it with CTest.

Coverage:

  • every option and the field it sets, and the positional input/output paths (including flags interleaved with positionals);
  • --rpath and --exclude-sce-module value consumption, including that the following token is taken verbatim and not re-parsed as a flag, and the "requires a value"/"requires a file name" errors when the value is missing;
  • unused-filter= value validation (0/1/2 only, exactly one digit) and the single-specification guard;
  • the --exclude-sce-module / --skip-sce-module conflict, in both orders;
  • the order-independent --windows-diagnostics / --windows-gui requirement on --windows;
  • unknown-option and extra-positional rejection, and the usage message when an input or output path is missing;
  • single-dash arguments being treated as positionals.

No production code is changed; this only documents and pins the parser's current behaviour.

Tested

Built relinker-only on macOS (Apple Silicon, AppleClang) with -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON; all CTest tests pass, including the new cli_args. Also run through the Build workflow on a fork (Ubuntu g++, Windows MinGW-w64, macOS clang). No title or homebrew involved — it is a host-side unit test.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt — N/A, test-only change, no exports added
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source — N/A, none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4793383997 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1856). Originally posted by [sarohy03](https://github.com/sarohy03) on 2026-10-08T22:09:42Z. --- ### What `Cli::ParseArgs` (`core/relinker/cli/src/CliArgs.cpp`) had no test coverage — the only test under `cli/tests/` is `AutorunExitTests`, which exercises the autorun launcher rather than the parser. This adds `cli_args_tests` and registers it with CTest. Coverage: - every option and the field it sets, and the positional input/output paths (including flags interleaved with positionals); - `--rpath` and `--exclude-sce-module` value consumption, including that the following token is taken verbatim and not re-parsed as a flag, and the "requires a value"/"requires a file name" errors when the value is missing; - `unused-filter=` value validation (0/1/2 only, exactly one digit) and the single-specification guard; - the `--exclude-sce-module` / `--skip-sce-module` conflict, in both orders; - the order-independent `--windows-diagnostics` / `--windows-gui` requirement on `--windows`; - unknown-option and extra-positional rejection, and the usage message when an input or output path is missing; - single-dash arguments being treated as positionals. No production code is changed; this only documents and pins the parser's current behaviour. ### Tested Built relinker-only on macOS (Apple Silicon, AppleClang) with `-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON`; all CTest tests pass, including the new `cli_args`. Also run through the Build workflow on a fork (Ubuntu g++, Windows MinGW-w64, macOS clang). No title or homebrew involved — it is a host-side unit test. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) — N/A, test-only change, no exports added - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source — N/A, none added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1856
No description provided.