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 {
11321132 name_prefix: []const u8,
11331133 filter: ?[]const u8,
11341134 single_threaded: bool,
1135 evented_io: bool = false,
11351136 code_model: builtin.CodeModel = .default,
11361137
11371138 root_src: ?FileSource,
......@@ -1559,6 +1560,11 @@ pub const LibExeObjStep = struct {
15591560 self.filter = text;
15601561 }
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
15621568 pub fn addCSourceFile(self: *LibExeObjStep, file: []const u8, args: []const []const u8) void {
15631569 self.addCSourceFileSource(.{
15641570 .args = args,
......@@ -1864,6 +1870,10 @@ pub const LibExeObjStep = struct {
18641870 try zig_args.append(filter);
18651871 }
18661872
1873 if (self.evented_io) {
1874 try zig_args.append("--test-evented-io");
1875 }
1876
18671877 if (self.name_prefix.len != 0) {
18681878 try zig_args.append("--test-name-prefix");
18691879 try zig_args.append(self.name_prefix);