test(host): the crash window's check runs through on Linux with g++ and clang #626

Open
zeldaootr wants to merge 1 commit from zeldaootr/Longshot:fix-crash-dialog-check-fixture into main
Contributor

Type: test · Risk: low · Tested on: Linux, no GPU (game-free check, g++ 13.3 and clang 23.1.5) · Needs: Windows, any GPU (game-free)

Why

tests/test_crash_dialog.py has failed on main since the crash window merged (#593): it never got past its own fixtures on Linux, so main is red before a release candidate and the crash window's real-run checks have not run at all. The crash window's code is right in everything the check reached once its fixtures were fixed. No open pull request or claim covers it.

How to reproduce

Seen on: Linux (Ubuntu 24.04), no GPU; g++ 13.3 and clang 23.1.5
Settings and switches: none
Steps: on main aa95d35f, run python -I -B tests/test_crash_dialog.py --cxx g++, then --cxx clang++
Expected: every PASS line, through PASS: Report: the clipboard's text has ...
Actual: with g++: AssertionError at assert run(exe, "args", *good).strip() == "1|1234|..." (the fixture prints 0|0||||NULL); with clang: clang++: error: '-x none' after last input file has no effect [-Werror,-Wunused-command-line-argument] building the fixture

What changed

Test-only, four faults of the check's own, each found once the one before it was out of the way. No product file changes, and every assertion is as it was.

  • args and options fixtures: they passed hos_crash_args argv + 1, so the program-name slot held their own command word and argv[1] was longshot: every helper command line read as the game's (0). They pass argv + 2, as main passes its own argv (host/hos_crash_dialog.c). (options, the settings file after the log, came with #729 and copied the same argv + 1: with only the args repair the check stopped there, at run(exe, "options", *good) == "1|NULL".)
  • Compiles: the fixture's -x none came after the last input, an error under clang's -Werror; it is dropped. The real-run driver's four C files each get their own -x c: g++ applies a single -x c to the first file only and compiled hos_crash_dialog.c and the rest as C++ ('_Bool' was not declared).
  • Real runs: the driver's stderr is /dev/null. hos_crash_record_start takes a regular file on stderr for the game's log (the game's own stderr is its log), so with the check's output in a file the helper looked for the run in that file, found no log, and the window named no stage (during the start missing).
  • Report runs: the second one in the same folder read the first one's events from out.txt; it is removed first, as the check already does elsewhere.

Measurements

Verdict: passes: the check fails on main and passes on this branch, with g++ and with clang, in two interleaved rounds.

Hardware: Linux (Ubuntu 24.04, kernel 6.8), x86-64, no GPU used; g++ 13.3.0, clang 23.1.5 (llvm-mingw's, --target=x86_64-linux-gnu), Python 3.15
Scene: no game: the game-free check, with its real helper runs against stand-in game processes
Method: the check run alone with --cxx g++ and with --cxx clang++, round 1 on main then this branch, round 2 the same again; failed runs per round (2 a round), and the PASS lines reached
How to reproduce: python -I -B tests/test_crash_dialog.py --cxx g++ (and --cxx clang++) on each commit, its output to a file

Before: main @ aa95d35f After: this PR @ 89fd00f1
Failed runs of 2, round 1 / round 2 2 / 2 0 / 0
PASS lines reached of 14 1 14
main@aa95d35f r1 test_crash_dialog.py g++ rc=1 pass=1 | AssertionError at assert run(exe, "args", *good).strip() == "1|1234|..."
main@aa95d35f r1 test_crash_dialog.py clangxx rc=1 pass=1 | clang++: error: '-x none' after last input file has no effect [-Werror,-Wunused-command-line-argument]
fix-crash-dialog-check-fixture@89fd00f1 r1 test_crash_dialog.py g++ rc=0 pass=14 | PASS: Report: the clipboard's text has the version, GPU, system, settings, record and log end, and nothing private
fix-crash-dialog-check-fixture@89fd00f1 r1 test_crash_dialog.py clangxx rc=0 pass=14 | PASS: Report: the clipboard's text has the version, GPU, system, settings, record and log end, and nothing private
(round 2: the same four results)

Flags and settings

None

Testing

Tested: on Linux, the whole check with g++ and clang, failing on main aa95d35f and passing here in two interleaved rounds, with its output both in a file and in the runner's pipe. The check has failed since a0dac82e (#593's merge), the only commit that touched it, hos_crash_dialog.c or hos_crash_dialog.h. The full suite (python -I -B tests/run_all.py, Linux, g++, LONGSHOT_VULKAN_HEADERS set) ran once on main aa95d35f with the other open fixes from the same sweep merged locally (ac6a1e97, not pushed, with this PR's head before the rebase, db15e4d5): 550 passed, 5 failed, 51 skipped. All five fail on clean main aa95d35f too: tests/test_make_game_cache.py, tests/test_options_budget_once.py, tests/test_mods_size_table.py, tests/test_walk_key.py, and this check, which there stopped at the options fixture this rebase repairs; with it, the check passes whole (above).

Not tested: Windows. There the check builds the same args fixture (the argv + 2 and the dropped -x none apply) and skips the real runs.

Must be tested:

  • Windows, any GPU (game-free, llvm-mingw clang): python -I -B tests/test_crash_dialog.py --cxx clang++, expecting every PASS line through PASS: the issue link: ... and the note that the real helper runs are Linux only (by hand: any Windows contributor; or the Test Farm: @Beanstalk windows, run tests/test_crash_dialog.py)

Risks

What could break: only this check.

Turning it off: revert the commit

Compatibility: Nothing changes

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
**Type:** test · **Risk:** low · **Tested on:** Linux, no GPU (game-free check, g++ 13.3 and clang 23.1.5) · **Needs:** Windows, any GPU (game-free) ## Why `tests/test_crash_dialog.py` has failed on `main` since the crash window merged (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/593): it never got past its own fixtures on Linux, so `main` is red before a release candidate and the crash window's real-run checks have not run at all. The crash window's code is right in everything the check reached once its fixtures were fixed. No open pull request or claim covers it. ## How to reproduce **Seen on:** Linux (Ubuntu 24.04), no GPU; g++ 13.3 and clang 23.1.5 **Settings and switches:** none **Steps:** on `main` aa95d35f, run `python -I -B tests/test_crash_dialog.py --cxx g++`, then `--cxx clang++` **Expected:** every PASS line, through `PASS: Report: the clipboard's text has ...` **Actual:** with g++: `AssertionError` at `assert run(exe, "args", *good).strip() == "1|1234|..."` (the fixture prints `0|0||||NULL`); with clang: `clang++: error: '-x none' after last input file has no effect [-Werror,-Wunused-command-line-argument]` building the fixture ## What changed Test-only, four faults of the check's own, each found once the one before it was out of the way. No product file changes, and every assertion is as it was. - `args` and `options` fixtures: they passed `hos_crash_args` `argv + 1`, so the program-name slot held their own command word and `argv[1]` was `longshot`: every helper command line read as the game's (0). They pass `argv + 2`, as `main` passes its own `argv` (`host/hos_crash_dialog.c`). (`options`, the settings file after the log, came with https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/729 and copied the same `argv + 1`: with only the `args` repair the check stopped there, at `run(exe, "options", *good) == "1|NULL"`.) - Compiles: the fixture's `-x none` came after the last input, an error under clang's `-Werror`; it is dropped. The real-run driver's four C files each get their own `-x c`: g++ applies a single `-x c` to the first file only and compiled `hos_crash_dialog.c` and the rest as C++ (`'_Bool' was not declared`). - Real runs: the driver's stderr is `/dev/null`. `hos_crash_record_start` takes a regular file on stderr for the game's log (the game's own stderr is its log), so with the check's output in a file the helper looked for the run in that file, found no log, and the window named no stage (`during the start` missing). - Report runs: the second one in the same folder read the first one's events from `out.txt`; it is removed first, as the check already does elsewhere. ## Measurements **Verdict:** passes: the check fails on `main` and passes on this branch, with g++ and with clang, in two interleaved rounds. Hardware: Linux (Ubuntu 24.04, kernel 6.8), x86-64, no GPU used; g++ 13.3.0, clang 23.1.5 (llvm-mingw's, `--target=x86_64-linux-gnu`), Python 3.15 Scene: no game: the game-free check, with its real helper runs against stand-in game processes Method: the check run alone with `--cxx g++` and with `--cxx clang++`, round 1 on main then this branch, round 2 the same again; failed runs per round (2 a round), and the PASS lines reached How to reproduce: `python -I -B tests/test_crash_dialog.py --cxx g++` (and `--cxx clang++`) on each commit, its output to a file | | Before: main @ aa95d35f | After: this PR @ 89fd00f1 | |---|---|---| | Failed runs of 2, round 1 / round 2 | 2 / 2 | 0 / 0 | | PASS lines reached of 14 | 1 | 14 | ``` main@aa95d35f r1 test_crash_dialog.py g++ rc=1 pass=1 | AssertionError at assert run(exe, "args", *good).strip() == "1|1234|..." main@aa95d35f r1 test_crash_dialog.py clangxx rc=1 pass=1 | clang++: error: '-x none' after last input file has no effect [-Werror,-Wunused-command-line-argument] fix-crash-dialog-check-fixture@89fd00f1 r1 test_crash_dialog.py g++ rc=0 pass=14 | PASS: Report: the clipboard's text has the version, GPU, system, settings, record and log end, and nothing private fix-crash-dialog-check-fixture@89fd00f1 r1 test_crash_dialog.py clangxx rc=0 pass=14 | PASS: Report: the clipboard's text has the version, GPU, system, settings, record and log end, and nothing private (round 2: the same four results) ``` ### Flags and settings None ## Testing **Tested:** on Linux, the whole check with g++ and clang, failing on main aa95d35f and passing here in two interleaved rounds, with its output both in a file and in the runner's pipe. The check has failed since a0dac82e (#593's merge), the only commit that touched it, `hos_crash_dialog.c` or `hos_crash_dialog.h`. The full suite (`python -I -B tests/run_all.py`, Linux, g++, `LONGSHOT_VULKAN_HEADERS` set) ran once on `main` aa95d35f with the other open fixes from the same sweep merged locally (ac6a1e97, not pushed, with this PR's head before the rebase, db15e4d5): 550 passed, 5 failed, 51 skipped. All five fail on clean `main` aa95d35f too: `tests/test_make_game_cache.py`, `tests/test_options_budget_once.py`, `tests/test_mods_size_table.py`, `tests/test_walk_key.py`, and this check, which there stopped at the `options` fixture this rebase repairs; with it, the check passes whole (above). **Not tested:** Windows. There the check builds the same `args` fixture (the `argv + 2` and the dropped `-x none` apply) and skips the real runs. **Must be tested:** - Windows, any GPU (game-free, llvm-mingw clang): `python -I -B tests/test_crash_dialog.py --cxx clang++`, expecting every PASS line through `PASS: the issue link: ...` and the note that the real helper runs are Linux only (by hand: any Windows contributor; or the Test Farm: @Beanstalk windows, run tests/test_crash_dialog.py) ## Risks **What could break:** only this check. **Turning it off:** revert the commit **Compatibility:** Nothing changes ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
make the crash window's check run as it was written
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
db15e4d5a1
Since #593 it never got past its fixtures on Linux:
- the `args` fixture handed `hos_crash_args` its own command word as the program name, so every helper command line read as the game's (0)
- `-x none` after the last input is an error under clang's `-Werror`; g++ takes one `-x c` for the first file only, and compiled the helper's other C files as C++
- with the check's output in a file, `hos_crash_record_start` took that file (the driver's stderr) for the game's log, so no stage was found
- the second Report run read the first one's events from `out.txt`, which is now removed before it, as elsewhere

Assisted-by: Claude
Author
Contributor

Rebased onto main aa95d35f (89fd00f1): #729 added an options fixture to this check that copied the same argv + 1, so with only the args repair the check stopped at run(exe, "options", *good) == "1|NULL"; it now passes argv + 2 too.
The whole check passes again with g++ and clang (14 of 14 PASS lines, two interleaved rounds; main reaches 1).

Rebased onto `main` aa95d35f (89fd00f1): #729 added an `options` fixture to this check that copied the same `argv + 1`, so with only the `args` repair the check stopped at `run(exe, "options", *good) == "1|NULL"`; it now passes `argv + 2` too. The whole check passes again with g++ and clang (14 of 14 PASS lines, two interleaved rounds; `main` reaches 1).
zeldaootr force-pushed fix-crash-dialog-check-fixture from db15e4d5a1
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 89fd00f127
Some checks are pending
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
2026-11-15 13:32:24 +00:00
Compare
Some checks are pending
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix-crash-dialog-check-fixture:zeldaootr-fix-crash-dialog-check-fixture'
git switch 'zeldaootr-fix-crash-dialog-check-fixture'
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!626
No description provided.