zig/lib/std/Build
mlugg 927f233ff8 compiler: allow emitting tests to an object file
This is fairly straightforward; the actual compiler changes are limited
to the CLI, since `Compilation` already supports this combination.

A new `std.Build` API is introduced to allow representing this. By
passing the `emit_object` option to `std.Build.addTest`, you get a
`Step.Compile` which emits an object file; you can then use that as you
would any other object, such as either installing it for external use,
or linking it into another step.

A standalone test is added to cover the build system API. It builds a
test into an object, and links it into a final executable, which it then
runs.

Using this build system mechanism prevents the build system from
noticing that you're running a `zig test`, so the build runner and test
runner do not communicate over stdio. However, that's okay, because the
real-world use cases for this feature don't want to do that anyway!

Resolves: #23374
2025-04-22 22:50:36 +01:00
..
Cache DepTokenizer: allow space between target and colon 2025-03-24 15:31:03 +01:00
Fuzz adjust runtime page size APIs 2025-02-06 14:23:23 -08:00
Step compiler: allow emitting tests to an object file 2025-04-22 22:50:36 +01:00
Cache.zig lib/std/Build/Cache.zig: remove .wasi SkipZigTest checks 2025-03-08 04:38:29 +01:00
Fuzz.zig Make -freference-trace work without colors 2025-01-30 13:02:06 +01:00
Module.zig compiler: allow emitting tests to an object file 2025-04-22 22:50:36 +01:00
Step.zig std.Build.Step: Don't capture a stack trace if !std.debug.sys_can_stack_trace. 2025-04-14 06:06:07 +02:00
Watch.zig std: eradicate u29 and embrace std.mem.Alignment 2025-04-13 02:20:32 -04:00