authorgravatar for isnt@haze.coolHaze Booth <isnt@haze.cool> 2020-05-05 11:49:33-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-05 15:16:54-04:00
loga39cb034ea0ae4f608ebcd7fa98df5d58d638668
tree0dd6481cdfa617d3896c916ad1feb816ba0b3654
parentb13a02ed1aaab407a29b37bb5559639bf3a69715

Add setUseTestEventedIO for test steps in build.zig


1 files changed, 10 insertions(+), 0 deletions(-)

lib/std/build.zig+10
...@@ -1132,6 +1132,7 @@ pub const LibExeObjStep = struct {...@@ -1132,6 +1132,7 @@ pub const LibExeObjStep = struct {
1132 name_prefix: []const u8,1132 name_prefix: []const u8,
1133 filter: ?[]const u8,1133 filter: ?[]const u8,
1134 single_threaded: bool,1134 single_threaded: bool,
1135 evented_io: bool = false,
1135 code_model: builtin.CodeModel = .default,1136 code_model: builtin.CodeModel = .default,
11361137
1137 root_src: ?FileSource,1138 root_src: ?FileSource,
...@@ -1559,6 +1560,11 @@ pub const LibExeObjStep = struct {...@@ -1559,6 +1560,11 @@ pub const LibExeObjStep = struct {
1559 self.filter = text;1560 self.filter = text;
1560 }1561 }
15611562
1563 pub fn setUseTestEventedIo(self: *LibExeObjStep, use_evented_io: bool) void {
1564 assert(self.kind == Kind.Test);
1565 self.evented_io = use_evented_io;
1566 }
1567
1562 pub fn addCSourceFile(self: *LibExeObjStep, file: []const u8, args: []const []const u8) void {1568 pub fn addCSourceFile(self: *LibExeObjStep, file: []const u8, args: []const []const u8) void {
1563 self.addCSourceFileSource(.{1569 self.addCSourceFileSource(.{
1564 .args = args,1570 .args = args,
...@@ -1864,6 +1870,10 @@ pub const LibExeObjStep = struct {...@@ -1864,6 +1870,10 @@ pub const LibExeObjStep = struct {
1864 try zig_args.append(filter);1870 try zig_args.append(filter);
1865 }1871 }
18661872
1873 if (self.evented_io) {
1874 try zig_args.append("--test-evented-io");
1875 }
1876
1867 if (self.name_prefix.len != 0) {1877 if (self.name_prefix.len != 0) {
1868 try zig_args.append("--test-name-prefix");1878 try zig_args.append("--test-name-prefix");
1869 try zig_args.append(self.name_prefix);1879 try zig_args.append(self.name_prefix);