authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-13 23:42:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:15-07:00
log3e328c89b7016cb688c88ddb11a8949851500928
treef1a50ec0e0148d38371932d33e109ca80fcd1d78
parent941cae4331ff4922ccef08a5d3d5879a0d1fa786

std.Build.CompileStep: remove setNamePrefix and add setName


2 files changed, 4 insertions(+), 13 deletions(-)

lib/std/Build/CompileStep.zig+2-9
...@@ -83,7 +83,6 @@ c_std: std.Build.CStd,...@@ -83,7 +83,6 @@ c_std: std.Build.CStd,
83zig_lib_dir: ?[]const u8,83zig_lib_dir: ?[]const u8,
84main_pkg_path: ?[]const u8,84main_pkg_path: ?[]const u8,
85exec_cmd_args: ?[]const ?[]const u8,85exec_cmd_args: ?[]const ?[]const u8,
86name_prefix: []const u8,
87filter: ?[]const u8,86filter: ?[]const u8,
88test_evented_io: bool = false,87test_evented_io: bool = false,
89test_runner: ?[]const u8,88test_runner: ?[]const u8,
...@@ -374,7 +373,6 @@ pub fn create(owner: *std.Build, options: Options) *CompileStep {...@@ -374,7 +373,6 @@ pub fn create(owner: *std.Build, options: Options) *CompileStep {
374 .zig_lib_dir = null,373 .zig_lib_dir = null,
375 .main_pkg_path = null,374 .main_pkg_path = null,
376 .exec_cmd_args = null,375 .exec_cmd_args = null,
377 .name_prefix = "",
378 .filter = null,376 .filter = null,
379 .test_runner = null,377 .test_runner = null,
380 .disable_stack_probing = false,378 .disable_stack_probing = false,
...@@ -847,10 +845,10 @@ fn linkSystemLibraryInner(self: *CompileStep, name: []const u8, opts: struct {...@@ -847,10 +845,10 @@ fn linkSystemLibraryInner(self: *CompileStep, name: []const u8, opts: struct {
847 }) catch @panic("OOM");845 }) catch @panic("OOM");
848}846}
849847
850pub fn setNamePrefix(self: *CompileStep, text: []const u8) void {848pub fn setName(self: *CompileStep, text: []const u8) void {
851 const b = self.step.owner;849 const b = self.step.owner;
852 assert(self.kind == .@"test");850 assert(self.kind == .@"test");
853 self.name_prefix = b.dupe(text);851 self.name = b.dupe(text);
854}852}
855853
856pub fn setFilter(self: *CompileStep, text: ?[]const u8) void {854pub fn setFilter(self: *CompileStep, text: ?[]const u8) void {
...@@ -1424,11 +1422,6 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {...@@ -1424,11 +1422,6 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
1424 try zig_args.append("--test-evented-io");1422 try zig_args.append("--test-evented-io");
1425 }1423 }
14261424
1427 if (self.name_prefix.len != 0) {
1428 try zig_args.append("--test-name-prefix");
1429 try zig_args.append(self.name_prefix);
1430 }
1431
1432 if (self.test_runner) |test_runner| {1425 if (self.test_runner) |test_runner| {
1433 try zig_args.append("--test-runner");1426 try zig_args.append("--test-runner");
1434 try zig_args.append(b.pathFromRoot(test_runner));1427 try zig_args.append(b.pathFromRoot(test_runner));
test/tests.zig+2-4
...@@ -1054,10 +1054,8 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S...@@ -1054,10 +1054,8 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S
1054 }1054 }
10551055
1056 const triple_prefix = c_abi_target.zigTriple(b.allocator) catch @panic("OOM");1056 const triple_prefix = c_abi_target.zigTriple(b.allocator) catch @panic("OOM");
1057 test_step.setNamePrefix(b.fmt("{s}-{s}-{s} ", .{1057 test_step.setName(b.fmt("test-c-abi-{s}-{s} ", .{
1058 "test-c-abi",1058 triple_prefix, @tagName(optimize_mode),
1059 triple_prefix,
1060 @tagName(optimize_mode),
1061 }));1059 }));
10621060
1063 const run = test_step.run();1061 const run = test_step.run();