zig/lib/std/Build/Step
mlugg 7e7d7875b9
std.Build: implement unit test timeouts
For now, there is a flag to `zig build` called `--test-timeout-ms` which
accepts a value in milliseconds. If the execution time of any individual
unit test exceeds that number of milliseconds, the test is terminated
and marked as timed out.

In the future, we may want to increase the granularity of this feature
by allowing timeouts to be specified per-step or even per-test. However,
a global option is actually very useful. In particular, it can be used
in CI scripts to ensure that no individual unit test exceeds some
reasonable limit (e.g. 60 seconds) without having to assign limits to
every individual test step in the build script.

Also, individual unit test durations are now shown in the time report
web interface -- this was fairly trivial to add since we're timing tests
(to check for timeouts) anyway.

This commit makes progress on #19821, but does not close it, because
that proposal includes a more sophisticated mechanism for setting
timeouts.

Co-Authored-By: David Rubin <david@vortan.dev>
2025-10-18 09:28:39 +01:00
..
CheckFile.zig rework std.Io.Writer.Allocating to support runtime-known alignment 2025-08-30 00:48:50 -07:00
CheckObject.zig std: fixes 2025-09-30 13:44:51 +01:00
Compile.zig Elf2: create a new linker from scratch 2025-09-21 14:09:14 -07:00
ConfigHeader.zig rework std.Io.Writer.Allocating to support runtime-known alignment 2025-08-30 00:48:50 -07: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 std.fmt: breaking API changes 2025-07-07 22:43:51 -07:00
InstallDir.zig std.fmt: breaking API changes 2025-07-07 22:43:51 -07:00
InstallFile.zig Build: add install commands to --verbose output 2025-06-19 11:45:06 -04:00
ObjCopy.zig std.Io: delete GenericReader 2025-08-29 17:14:26 -07:00
Options.zig build system: replace fuzzing UI with build UI, add time report 2025-08-01 23:48:21 +01:00
RemoveDir.zig make zig compiler processes live across rebuilds 2024-07-14 19:51:16 -07:00
Run.zig std.Build: implement unit test timeouts 2025-10-18 09:28:39 +01:00
TranslateC.zig std.Build.Step.TranslateC: forward --cache-dir and --global-cache-dir flags 2025-08-26 03:54:00 +00:00
UpdateSourceFiles.zig std.fmt: breaking API changes 2025-07-07 22:43:51 -07:00
WriteFile.zig std.fmt: breaking API changes 2025-07-07 22:43:51 -07:00