aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
Diffstat (limited to 'std')
-rw-r--r--std/build.zig17
1 files changed, 17 insertions, 0 deletions
diff --git a/std/build.zig b/std/build.zig
index dbd163966c..9b5c61c8f1 100644
--- a/std/build.zig
+++ b/std/build.zig
@@ -1028,6 +1028,7 @@ pub const TestStep = struct {
name_prefix: []const u8,
filter: ?[]const u8,
target: Target,
+ exec_cmd_args: ?[]const ?[]const u8,
pub fn init(builder: &Builder, root_src: []const u8) -> TestStep {
const step_name = builder.fmt("test {}", root_src);
@@ -1041,6 +1042,7 @@ pub const TestStep = struct {
.filter = null,
.link_libs = BufSet.init(builder.allocator),
.target = Target.Native,
+ .exec_cmd_args = null,
}
}
@@ -1076,6 +1078,10 @@ pub const TestStep = struct {
};
}
+ pub fn setExecCmd(self: &TestStep, args: []const ?[]const u8) {
+ self.exec_cmd_args = args;
+ }
+
fn make(step: &Step) -> %void {
const self = @fieldParentPtr(TestStep, "step", step);
const builder = self.builder;
@@ -1129,6 +1135,17 @@ pub const TestStep = struct {
}
}
+ if (self.exec_cmd_args) |exec_cmd_args| {
+ for (exec_cmd_args) |cmd_arg| {
+ if (cmd_arg) |arg| {
+ %%zig_args.append("--test-cmd");
+ %%zig_args.append(arg);
+ } else {
+ %%zig_args.append("--test-cmd-bin");
+ }
+ }
+ }
+
for (builder.include_paths.toSliceConst()) |include_path| {
%%zig_args.append("-isystem");
%%zig_args.append(builder.pathFromRoot(include_path));