zig/lib/std/Build/Step
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
..
CheckFile.zig make zig compiler processes live across rebuilds 2024-07-14 19:51:16 -07:00
CheckObject.zig std: eradicate u29 and embrace std.mem.Alignment 2025-04-13 02:20:32 -04:00
Compile.zig compiler: allow emitting tests to an object file 2025-04-22 22:50:36 +01:00
ConfigHeader.zig std.Build.Step.ConfigHeader: follow deprecation policy 2025-02-23 12:45:35 -08:00
Fail.zig make zig compiler processes live across rebuilds 2024-07-14 19:51:16 -07:00
Fmt.zig Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
InstallArtifact.zig compiler: allow emitting tests to an object file 2025-04-22 22:50:36 +01:00
InstallDir.zig make zig compiler processes live across rebuilds 2024-07-14 19:51:16 -07:00
InstallFile.zig make zig compiler processes live across rebuilds 2024-07-14 19:51:16 -07:00
ObjCopy.zig std.Build: remove deprecated APIs 2024-12-18 01:47:50 +05:00
Options.zig Revert "Merge pull request #22898 from kristoff-it/deprecated-proposal" 2025-02-28 01:37:10 -08:00
RemoveDir.zig make zig compiler processes live across rebuilds 2024-07-14 19:51:16 -07:00
Run.zig zig build: add env_map entries to hash for Step.Run 2025-03-26 14:48:04 +01:00
TranslateC.zig std.Build: add API to create Compile steps from existing module 2024-12-18 01:48:54 +05:00
UpdateSourceFiles.zig make zig compiler processes live across rebuilds 2024-07-14 19:51:16 -07:00
WriteFile.zig make zig compiler processes live across rebuilds 2024-07-14 19:51:16 -07:00