GPU: rename the second test module in host.rs so the tests compile #129

Manually merged
github merged 1 commit from gh-pr/129/head into gh-pr/129/base 2026-11-26 03:51:23 +00:00
Owner

@⁠Luislariosss on GitHub · 2026-11-24 00:46 UTC · original
Luislariosss:fix/duplicate-test-module → main · +1 −1 · 1 files · 1 commits · merged 2026-11-24 00:57 UTC

cargo test --workspace does not compile on main:

error[E0428]: the name `tests` is defined multiple times
--> crates\victory-gpu\src\host.rs:1974:1

host.rs declares #[cfg(test)] mod tests twice: one near the top (the warp adapter test) and one at the end (the Batch::texture_due tests). They arrived in different merges, and rustc stops the crate before running anything.

Fix

The second block only touches Batch, so it becomes mod batch and keeps both of its tests. One line, no test bodies changed.

Verified

before:  error[E0428] ... could not compile `victory-gpu` (lib test)
after:   cargo test -p victory-gpu --lib     43 passed, 0 failed, 1 ignored
         cargo test --workspace              compiles and every crate reports ok
         cargo clippy --workspace --all-targets   clean
         cargo xtask policy                  151 files ok

I found this while checking that the tree still builds without the game, which is the state a contributor needs before touching anything. AI-assisted.

**@⁠Luislariosss** on GitHub · 2026-11-24 00:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/129) `Luislariosss:fix/duplicate-test-module` → `main` · +1 −1 · 1 files · 1 commits · merged 2026-11-24 00:57 UTC `cargo test --workspace` does not compile on `main`: ``` error[E0428]: the name `tests` is defined multiple times --> crates\victory-gpu\src\host.rs:1974:1 ``` `host.rs` declares `#[cfg(test)] mod tests` twice: one near the top (the warp adapter test) and one at the end (the `Batch::texture_due` tests). They arrived in different merges, and rustc stops the crate before running anything. ## Fix The second block only touches `Batch`, so it becomes `mod batch` and keeps both of its tests. One line, no test bodies changed. ## Verified ``` before: error[E0428] ... could not compile `victory-gpu` (lib test) after: cargo test -p victory-gpu --lib 43 passed, 0 failed, 1 ignored cargo test --workspace compiles and every crate reports ok cargo clippy --workspace --all-targets clean cargo xtask policy 151 files ok ``` I found this while checking that the tree still builds without the game, which is the state a contributor needs before touching anything. AI-assisted.
cargo test --workspace does not compile on main: host.rs declares
#[cfg(test)] mod tests twice, once near the top for the warp adapter test and
once at the end for the Batch::texture_due tests, so rustc rejects the crate
with E0428 before running anything:

    error[E0428]: the name 	ests is defined multiple times
    --> crates\victory-gpu\src\host.rs:1974:1

The second block only touches Batch, so it becomes mod batch and keeps its
two tests. cargo test -p victory-gpu --lib goes from "could not compile" to
43 passed, 0 failed, 1 ignored, and cargo test --workspace compiles again.
Nothing else changes: one line, no test bodies touched.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:51:19 +00:00
github manually merged commit 7102a4989c into gh-pr/129/base 2026-11-26 03:51:23 +00:00
Author
Owner

@⁠TheHoracio on GitHub · 2026-11-24 00:48 UTC · original

Tested on AMD RDNA3: RX 7800 XT (16 GB), driver 32.0.32015.7029, Ryzen 7 9800X3D, Windows 11 Pro 10.0.26300, toolchain 1.98.1 from rust-toolchain.toml, debug build. No game data was used.

  • main 9aef3d9: cargo test --workspace fails with the same E0428 in crates\victory-gpu\src\host.rs:1974.
  • PR head 7102a49 (on 8a8a38d): cargo test --workspace 263 passed, 0 failed, 4 ignored. host::batch::a_texture_is_checked_once_per_submission and host::tests::warp_adapter_accepts_only_software both pass.
  • PR head merged onto main 9aef3d9: merges cleanly, 264 passed, 0 failed, 4 ignored.

Not tested: clippy, cargo xtask policy, a release build of the tests.

AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above.

**@⁠TheHoracio** on GitHub · 2026-11-24 00:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/129#issuecomment-7118455924) Tested on **AMD RDNA3**: RX 7800 XT (16 GB), driver 32.0.32015.7029, Ryzen 7 9800X3D, Windows 11 Pro 10.0.26300, toolchain 1.98.1 from `rust-toolchain.toml`, debug build. No game data was used. - `main` `9aef3d9`: `cargo test --workspace` fails with the same `E0428` in `crates\victory-gpu\src\host.rs:1974`. - PR head `7102a49` (on `8a8a38d`): `cargo test --workspace` **263 passed, 0 failed, 4 ignored**. `host::batch::a_texture_is_checked_once_per_submission` and `host::tests::warp_adapter_accepts_only_software` both pass. - PR head merged onto `main` `9aef3d9`: merges cleanly, **264 passed, 0 failed, 4 ignored**. **Not tested:** clippy, `cargo xtask policy`, a release build of the tests. AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above.
Author
Owner

@⁠lordon1a on GitHub · 2026-11-24 00:51 UTC · original

Verified 7102a4989 on Windows 11 (x86_64-pc-windows-gnullvm, rustc 1.100.0, applied cleanly to main@4c0bb89): pass.

  • cargo xtask policy: 151 files ok
  • cargo test -p victory-gpu: 43 passed, 0 failed, 1 ignored (fixes the E0428 duplicate mod tests build failure on main@4c0bb89).

AI-assisted.

**@⁠lordon1a** on GitHub · 2026-11-24 00:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/129#issuecomment-7118511493) Verified `7102a4989` on Windows 11 (`x86_64-pc-windows-gnullvm`, `rustc 1.100.0`, applied cleanly to `main@4c0bb89`): **pass**. - `cargo xtask policy`: 151 files ok - `cargo test -p victory-gpu`: **43 passed, 0 failed, 1 ignored** (fixes the E0428 duplicate `mod tests` build failure on `main@4c0bb89`). AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!129
No description provided.