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

Closed
opened 2026-11-28 10:09:06 +00:00 by github-bot · 6 comments
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 10:02 UTC · original

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** on GitHub · 2026-11-28 10:02 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580) ## 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 10:09:06 +00:00
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 10:02 UTC · original

/claim

**@⁠AnastasisKon** on GitHub · 2026-11-28 10:02 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7237635465) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 10:03 UTC · original

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

**@⁠github-actions[bot]** on GitHub · 2026-11-28 10:03 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7237637311) Claimed by @⁠AnastasisKon. Open a draft pull request with `Refs #580` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 12:37 UTC · original

/release - done: PR #585 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** on GitHub · 2026-11-28 12:37 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7239353694) /release - done: PR #585 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.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 12:42 UTC · original

/release - done: PR #585 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** on GitHub · 2026-11-28 12:42 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7239416076) /release - done: PR #585 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.
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 12:43 UTC · original

Released. This issue is free to claim.

**@⁠github-actions[bot]** on GitHub · 2026-11-28 12:43 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7239418760) Released. This issue is free to claim.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 17:15 UTC · original

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.

**@⁠AnastasisKon** on GitHub · 2026-11-28 17:15 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/580#issuecomment-7242880743) 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.