aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-17 14:43:51 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-09-17 14:43:51 -0400
commit7ee00730ac5679ea5e24fac352ed9b72469f9329 (patch)
treef05bee8200126abc3fe9b4ac019357fe239078e2 /std
parenta9ecb26c34d77f616fb029af3d09ffd69b9aa178 (diff)
downloadzig-7ee00730ac5679ea5e24fac352ed9b72469f9329.tar.gz
zig-7ee00730ac5679ea5e24fac352ed9b72469f9329.zip
add option to run tests in LLDB and turn it on for macos travis
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));