zig/test
Matthew Lugg c6b5945356 std.Build: don't force all children to inherit color option
The build runner was previously forcing child processes to have their
stderr colorization match the build runner by setting `CLICOLOR_FORCE`
or `NO_COLOR`. This is a nice idea in some cases---for instance a simple
`Run` step which we just expect to exit with code 0 and whose stderr is
not being programmatically inspected---but is a bad idea in others, for
instance if there is a check on stderr or if stderr is captured, in
which case forcing color on the child could cause checks to fail.

Instead, this commit adds a field to `std.Build.Step.Run` which
specifies a behavior for the build runner to employ in terms of
assigning the `CLICOLOR_FORCE` and `NO_COLOR` environment variables. The
default behavior is to set `CLICOLOR_FORCE` if the build runner's output
is colorized and the step's stderr is not captured, and to set
`NO_COLOR` otherwise. Alternatively, colors can be always enabled,
always disabled, always match the build runner, or the environment
variables can be left untouched so they can be manually controlled
through `env_map`.

Notably, this fixes a failure when running `zig build test-cli` in a
TTY (or with colors explicitly enabled). GitHub CI hadn't caught this
because it does not request color, but Codeberg CI now does, and we were
seeing a failure in the `zig init` test because the actual output had
color escape codes in it due to 6d280dc.
2025-11-14 21:50:24 +01:00
..
behavior represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
c_abi represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
cases fix 'redundant comptime keyword' error source location and add tests 2025-11-13 19:47:36 +00:00
cli/options test: move standalone/options/ to cli/options/ 2025-10-04 21:55:39 +02:00
incremental Coff2: create a new linker from scratch 2025-10-02 17:44:52 -04:00
link zig fmt: fix extra whitespace in StructInit with multiline strings 2025-11-05 14:07:30 +02:00
src disable self-hosted wasm test-cases 2025-10-29 06:20:51 -07:00
standalone std.Build: don't force all children to inherit color option 2025-11-14 21:50:24 +01:00
behavior.zig delete behavior test that depends on std.fmt 2025-08-31 12:49:18 -07:00
cases.zig test: remove ad-hoc nvptx tests 2025-10-04 20:51:07 +02:00
compile_errors.zig compiler: refactor Zcu.File and path representation 2025-05-18 17:37:02 +01:00
error_traces.zig test: disable an error trace test on optimized riscv64-linux 2025-10-01 12:58:20 +02:00
gen_h.zig
libc.zig libc-test: disable utime.c 2025-10-15 10:58:30 +02:00
llvm_ir.zig test: Add some basic LLVM IR tests for atomics, volatile, and allowzero. 2025-05-12 17:07:50 +02:00
llvm_targets.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
stack_traces.zig std: back out the StackTrace byval changes 2025-10-29 06:20:50 -07:00
tests.zig remove all Oracle Solaris support 2025-10-27 07:35:38 -07:00