Skip to content

test: compile stdx as its own test root — its tests had never run - #65

Merged
oreofeolurin merged 3 commits into
devfrom
fix/stdx-tests-never-ran
Aug 30, 2026
Merged

test: compile stdx as its own test root — its tests had never run#65
oreofeolurin merged 3 commits into
devfrom
fix/stdx-tests-never-ran

Conversation

@oreofeolurin

Copy link
Copy Markdown
Contributor

What

Adds a second test compilation rooted at src/stdx/mod.zig to zig build test / test-unit, references the PRNG's tests so they're collected, fixes TestLogger (didn't compile on Zig 0.16 — ArrayList init + writer API drift), and deletes no_padding (@bitSizeOf now includes struct padding, making the check vacuously true; zero call sites).

Why

stdx is its own module, and module dependencies contribute no tests to a test root — so no stdx test has ever run in any build step. Surfaced by review on #58, which needs the deterministic PRNG's tests actually executing. Lazy analysis hiding broken code is this repo's known failure mode; this closes it for stdx's referenced files.

Watch

  • 41 stdx tests now run (previously 0); 1373/1373 total locally.
  • Only files referenced from mod.zig test blocks are collected — a sweep to reference the rest (fs, net, time, io, e2e framework) is follow-up work.
  • e2e job is red on all PRs from the pre-existing cluster bring-up issue on dev, unrelated to this change.

stdx is a separate module, and module dependencies contribute no tests to
a test root, so every test in stdx (PRNG, log, helpers) was invisible to
zig build test. Adding the root immediately caught two casualties of that
blind spot: TestLogger no longer compiled on Zig 0.16 (ArrayList init and
writer API drift), and no_padding became vacuous (@bitSizeOf now includes
struct padding, so the check is always true) — fixed and deleted
respectively. 41 stdx tests now run under test/test-unit.
The new stdx test root failed to compile on Linux:

    std/c.zig: error: dependency on libc must be explicitly specified

stdx wraps libc directly — std.c sockets, fcntl, file IO — so it needs the
link wherever it is rooted. Every consumer sets link_libc on its own root
module, which covers stdx as a dependency but not a test artifact rooted at
stdx itself. macOS links libc implicitly, so this only showed up on Linux.

Verified test-unit passes on both macOS and Linux.
@oreofeolurin
oreofeolurin merged commit 89973d2 into dev Aug 30, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant