Zig Version
0.11.0-dev.2165+8f481dfc3
Steps to Reproduce and Observed Behavior
// build.zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const exe_tests = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
});
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&exe_tests.step);
}
// src/main.zig
test "simple test" {
unreachable;
}
Expected Behavior
I expect to get a stack trace in my terminal showing the test failure. Instead, the command silently exits with a successful status code.
Running zig build test --verbose we can see that it seems to be actually running the test:
$ zig build test --verbose
<path-to>/zig test <path-to>/src/main.zig --cache-dir <path-to>/zig-cache --global-cache-dir <path-to>/.cache/zig --name test --enable-cache --listen=-
If I take the same command, remove --listen=-, this works just fine:
$ <path-to>/zig test <path-to>/src/main.zig --cache-dir <path-to>/zig-cache --global-cache-dir <path-to>/.cache/zig --name test --enable-cache
<path-to>/zig-cache/o/25622b855bc097280dff3f8cb897732b
Test [1/1] test.simple test... thread 80083 panic: reached unreachable code
<path-to>/src/main.zig:2:5: 0x20dc95 in test.simple test (test)
unreachable;
^
...
Zig Version
0.11.0-dev.2165+8f481dfc3
Steps to Reproduce and Observed Behavior
Expected Behavior
I expect to get a stack trace in my terminal showing the test failure. Instead, the command silently exits with a successful status code.
Running
zig build test --verbosewe can see that it seems to be actually running the test:If I take the same command, remove
--listen=-, this works just fine: