tools: run-native.sh's argument checks and missing-game paths have no test, and its two --console forms disagree #580

Closed
opened 2026-11-28 10:02:57 +00:00 by AnastasisKon · 6 comments
AnastasisKon commented 2026-11-28 10:02:57 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T10:02:57Z.


What

tools/macos/run-native.sh is what every tester and every agent runs, and its first job is refusing bad input clearly: no argument, two targets, --seconds without a value or with a non-number, a value past the timer range, --console without a model, a path that is not a file, and a folder whose download does not hold game_*master.exe yet. Every one of those paths exists, and none is covered by a test — console-default.sh covers only the RAM-to-model rule inside it.

Writing the test turned up one real inconsistency: --console -h is refused ("requires a model", because the next word starts with -), but --console=-h was accepted and passed to the game as the model, so a forgotten model showed up as the game's own parser error instead of this script's message.

What this changes

  • --console=<value> refuses a value starting with -, the same rule the space form already applies, so both forms answer the same way.
  • tools/macos/tests/run-native-args.sh pins all of the checks above, without a game and without building: every case stops before the game is launched, and the two "no executable" cases are exactly what a partial download or the wrong folder produces.
  • the step runs in the macos-scripts CI job, next to the other script tests.

How it was tested

  • /bin/bash tools/macos/tests/run-native-args.sh: passes, and each case asserts both the exit status (2, or 0 for --help) and the message.
  • The other nine macos-scripts tests still pass, run as ci.yml runs them.
  • cargo xtask policy: 399 files ok.
  • By hand on a real folder that holds the archives but not the executable yet: No game_*master.exe found in /Volumes/…, exit 2, nothing launched.
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6663092370 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T10:02:57Z. --- ## What `tools/macos/run-native.sh` is what every tester and every agent runs, and its first job is refusing bad input clearly: no argument, two targets, `--seconds` without a value or with a non-number, a value past the timer range, `--console` without a model, a path that is not a file, and a folder whose download does not hold `game_*master.exe` yet. Every one of those paths exists, and none is covered by a test — `console-default.sh` covers only the RAM-to-model rule inside it. Writing the test turned up one real inconsistency: `--console -h` is refused ("requires a model", because the next word starts with `-`), but `--console=-h` was accepted and passed to the game as the model, so a forgotten model showed up as the game's own parser error instead of this script's message. ## What this changes - `--console=<value>` refuses a value starting with `-`, the same rule the space form already applies, so both forms answer the same way. - `tools/macos/tests/run-native-args.sh` pins all of the checks above, without a game and without building: every case stops before the game is launched, and the two "no executable" cases are exactly what a partial download or the wrong folder produces. - the step runs in the `macos-scripts` CI job, next to the other script tests. ## How it was tested - `/bin/bash tools/macos/tests/run-native-args.sh`: passes, and each case asserts both the exit status (2, or 0 for `--help`) and the message. - The other nine `macos-scripts` tests still pass, run as `ci.yml` runs them. - `cargo xtask policy`: 399 files ok. - By hand on a real folder that holds the archives but not the executable yet: `No game_*master.exe found in /Volumes/…`, exit 2, nothing launched.
AnastasisKon commented 2026-11-28 10:02:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T10:02:58Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7237635465 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7237635465). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T10:02:58Z. --- /claim
github-actions[bot] commented 2026-11-28 10:03:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T10:03:08Z.


Claimed by @AnastasisKon. Open a draft pull request with Refs #580 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7237637311 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7237637311). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T10:03:08Z. --- Claimed by @AnastasisKon. Open a draft pull request with `Refs #580` in its description within 24 hours, or the claim expires.
AnastasisKon commented 2026-11-28 12:37:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:37:20Z.


/release - done: PR #581 tests run-native.sh's argument checks and refuses --console=-x. Carried in my fork's main (69146296). Note the PR itself now shows CONFLICTING against upstream; that is only upstream-facing, the commit is in my fork intact.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7239353694 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7239353694). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T12:37:20Z. --- /release - done: PR #581 tests run-native.sh's argument checks and refuses `--console=-x`. Carried in my fork's `main` (69146296). Note the PR itself now shows CONFLICTING against upstream; that is only upstream-facing, the commit is in my fork intact.
AnastasisKon commented 2026-11-28 12:42:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:42:51Z.


/release - done: PR #581 tests run-native.sh's argument checks and refuses --console=-x. Carried in my fork's main (69146296). Note the PR itself now shows CONFLICTING against upstream; that is only upstream-facing, the commit is in my fork intact.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7239416076 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7239416076). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T12:42:51Z. --- /release - done: PR #581 tests run-native.sh's argument checks and refuses `--console=-x`. Carried in my fork's `main` (69146296). Note the PR itself now shows CONFLICTING against upstream; that is only upstream-facing, the commit is in my fork intact.
github-actions[bot] commented 2026-11-28 12:43:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T12:43:05Z.


Released. This issue is free to claim.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7239418760 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7239418760). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T12:43:05Z. --- Released. This issue is free to claim.
AnastasisKon commented 2026-11-28 17:15:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T17:15:50Z.


Already in the tree: tools/macos/tests/run-native-args.sh exists and runs in the macos-scripts job, and --console= refuses a value starting with - (run-native.sh:25-30). Closing.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7242880743 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7242880743). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T17:15:50Z. --- Already in the tree: `tools/macos/tests/run-native-args.sh` exists and runs in the `macos-scripts` job, and `--console=` refuses a value starting with `-` (run-native.sh:25-30). Closing.
Sign in to join this conversation.
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
LakshanSivakumar/Native-Victory-macOS#580
No description provided.