Skip to content

Commit 59fd630

Browse files
committed
build: simplify test output and rename steps
- Rename test steps from `verify-*` to `test-*` for consistency. - Simplify `[TEST]` log message format. - Remove redundant comments.
1 parent 1708564 commit 59fd630

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

build.zig

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,13 @@ const Target = struct {
77
};
88

99
const targets = [_]Target{
10-
// Linux x64 (glibc)
1110
.{ .target = "x86_64-linux-gnu", .os = .linux, .arch = .x86_64 },
12-
// Linux ARM64 (glibc)
1311
.{ .target = "aarch64-linux-gnu", .os = .linux, .arch = .aarch64 },
14-
// Linux x64 (musl)
1512
.{ .target = "x86_64-linux-musl", .os = .linux, .arch = .x86_64 },
16-
// Linux ARM64 (musl)
1713
.{ .target = "aarch64-linux-musl", .os = .linux, .arch = .aarch64 },
18-
// Windows x64
1914
.{ .target = "x86_64-windows-gnu", .os = .windows, .arch = .x86_64 },
20-
// Windows ARM64
2115
.{ .target = "aarch64-windows-gnu", .os = .windows, .arch = .aarch64 },
22-
// macOS x64
2316
.{ .target = "x86_64-macos", .os = .macos, .arch = .x86_64 },
24-
// macOS ARM64
2517
.{ .target = "aarch64-macos", .os = .macos, .arch = .aarch64 },
2618
};
2719

@@ -61,7 +53,7 @@ const TestStep = struct {
6153
self.* = .{
6254
.step = std.Build.Step.init(.{
6355
.id = .custom,
64-
.name = b.fmt("verify-{s}-{s}", .{ t.target, ccache_str }),
56+
.name = b.fmt("test-{s}-{s}", .{ t.target, ccache_str }),
6557
.owner = b,
6658
.makeFn = make,
6759
}),
@@ -90,7 +82,7 @@ fn run_test(b: *std.Build, t: Target, use_ccache: bool) !void {
9082
const source_dir = try std.fs.path.join(allocator, &.{ cwd, "test" });
9183
const ccache_status = if (use_ccache) "ON" else "OFF";
9284

93-
std.debug.print("\n[TEST] Target: {s} | Ccache: {s}...\n", .{ t.target, ccache_status });
85+
std.debug.print("\n[TEST] {s} | Ccache: {s}\n", .{ t.target, ccache_status });
9486

9587
// Configure
9688
try run_command(allocator, &[_][]const u8{
@@ -127,6 +119,7 @@ fn run_test(b: *std.Build, t: Target, use_ccache: bool) !void {
127119
try verify_binary_header(bin_path, t.os, t.arch);
128120
std.debug.print(" [OK] {s}\n", .{name});
129121
}
122+
130123
const duration = timer.read() / std.time.ns_per_ms;
131124
std.debug.print("[PASS] All checks passed for {s} ({d}ms)\n", .{ t.target, duration });
132125
}
@@ -201,8 +194,6 @@ fn verify_binary_header(path: []const u8, os: std.Target.Os.Tag, arch: std.Targe
201194

202195
fn run_command(allocator: std.mem.Allocator, argv: []const []const u8) !void {
203196
var child = std.process.Child.init(argv, allocator);
204-
// Ignore stdout to avoid memory pressure from capturing large outputs.
205-
// We rely on stderr for error reporting and exit codes for status.
206197
child.stdout_behavior = .Ignore;
207198
child.stderr_behavior = .Inherit;
208199
const term = try child.spawnAndWait();

0 commit comments

Comments
 (0)