From 3e328c89b7016cb688c88ddb11a8949851500928 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 13 Mar 2023 23:42:15 -0700 Subject: [PATCH] std.Build.CompileStep: remove setNamePrefix and add setName --- lib/std/Build/CompileStep.zig | 11 ++--------- test/tests.zig | 6 ++---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/std/Build/CompileStep.zig b/lib/std/Build/CompileStep.zig index 92492e9593..d73e5d3b41 100644 --- a/lib/std/Build/CompileStep.zig +++ b/lib/std/Build/CompileStep.zig @@ -83,7 +83,6 @@ c_std: std.Build.CStd, zig_lib_dir: ?[]const u8, main_pkg_path: ?[]const u8, exec_cmd_args: ?[]const ?[]const u8, -name_prefix: []const u8, filter: ?[]const u8, test_evented_io: bool = false, test_runner: ?[]const u8, @@ -374,7 +373,6 @@ pub fn create(owner: *std.Build, options: Options) *CompileStep { .zig_lib_dir = null, .main_pkg_path = null, .exec_cmd_args = null, - .name_prefix = "", .filter = null, .test_runner = null, .disable_stack_probing = false, @@ -847,10 +845,10 @@ fn linkSystemLibraryInner(self: *CompileStep, name: []const u8, opts: struct { }) catch @panic("OOM"); } -pub fn setNamePrefix(self: *CompileStep, text: []const u8) void { +pub fn setName(self: *CompileStep, text: []const u8) void { const b = self.step.owner; assert(self.kind == .@"test"); - self.name_prefix = b.dupe(text); + self.name = b.dupe(text); } pub fn setFilter(self: *CompileStep, text: ?[]const u8) void { @@ -1424,11 +1422,6 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { try zig_args.append("--test-evented-io"); } - if (self.name_prefix.len != 0) { - try zig_args.append("--test-name-prefix"); - try zig_args.append(self.name_prefix); - } - if (self.test_runner) |test_runner| { try zig_args.append("--test-runner"); try zig_args.append(b.pathFromRoot(test_runner)); diff --git a/test/tests.zig b/test/tests.zig index 7af1ba6c3b..737cf5e291 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -1054,10 +1054,8 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S } const triple_prefix = c_abi_target.zigTriple(b.allocator) catch @panic("OOM"); - test_step.setNamePrefix(b.fmt("{s}-{s}-{s} ", .{ - "test-c-abi", - triple_prefix, - @tagName(optimize_mode), + test_step.setName(b.fmt("test-c-abi-{s}-{s} ", .{ + triple_prefix, @tagName(optimize_mode), })); const run = test_step.run();