diff options
| author | Takeshi Yoneda <takeshi@tetrate.io> | 2021-08-09 14:39:26 +0900 |
|---|---|---|
| committer | Takeshi Yoneda <takeshi@tetrate.io> | 2021-08-09 14:39:26 +0900 |
| commit | 97560cd915008f04addc2c30af087aa89c162b02 (patch) | |
| tree | 8aed12c207ff84cc256a0c78955c23b61129ba22 /test/tests.zig | |
| parent | 7814a2bd4a3ec22cd9548c622f7dc837dba968f7 (diff) | |
| parent | 799fedf612aa8742c446b015c12d21707a1dbec0 (diff) | |
| download | zig-97560cd915008f04addc2c30af087aa89c162b02.tar.gz zig-97560cd915008f04addc2c30af087aa89c162b02.zip | |
Merge remote-tracking branch 'origin' into libc-wasi-test
Diffstat (limited to 'test/tests.zig')
| -rw-r--r-- | test/tests.zig | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/test/tests.zig b/test/tests.zig index d83701ff6a..a427bbefeb 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -391,7 +391,14 @@ pub fn addRuntimeSafetyTests(b: *build.Builder, test_filter: ?[]const u8, modes: return cases.step; } -pub fn addStandaloneTests(b: *build.Builder, test_filter: ?[]const u8, modes: []const Mode, skip_non_native: bool, target: std.zig.CrossTarget) *build.Step { +pub fn addStandaloneTests( + b: *build.Builder, + test_filter: ?[]const u8, + modes: []const Mode, + skip_non_native: bool, + enable_macos_sdk: bool, + target: std.zig.CrossTarget, +) *build.Step { const cases = b.allocator.create(StandaloneContext) catch unreachable; cases.* = StandaloneContext{ .b = b, @@ -400,6 +407,7 @@ pub fn addStandaloneTests(b: *build.Builder, test_filter: ?[]const u8, modes: [] .test_filter = test_filter, .modes = modes, .skip_non_native = skip_non_native, + .enable_macos_sdk = enable_macos_sdk, .target = target, }; @@ -768,7 +776,7 @@ pub const StackTracesContext = struct { var buf = ArrayList(u8).init(b.allocator); defer buf.deinit(); if (stderr.len != 0 and stderr[stderr.len - 1] == '\n') stderr = stderr[0 .. stderr.len - 1]; - var it = mem.split(stderr, "\n"); + var it = mem.split(u8, stderr, "\n"); process_lines: while (it.next()) |line| { if (line.len == 0) continue; @@ -839,6 +847,7 @@ pub const StandaloneContext = struct { test_filter: ?[]const u8, modes: []const Mode, skip_non_native: bool, + enable_macos_sdk: bool, target: std.zig.CrossTarget, pub fn addC(self: *StandaloneContext, root_src: []const u8) void { @@ -849,9 +858,15 @@ pub const StandaloneContext = struct { self.addAllArgs(root_src, false); } - pub fn addBuildFile(self: *StandaloneContext, build_file: []const u8, features: struct { build_modes: bool = false, cross_targets: bool = false }) void { + pub fn addBuildFile(self: *StandaloneContext, build_file: []const u8, features: struct { + build_modes: bool = false, + cross_targets: bool = false, + requires_macos_sdk: bool = false, + }) void { const b = self.b; + if (features.requires_macos_sdk and !self.enable_macos_sdk) return; + const annotated_case_name = b.fmt("build {s}", .{build_file}); if (self.test_filter) |filter| { if (mem.indexOf(u8, annotated_case_name, filter) == null) return; |
