diff --git a/lib/std/build.zig b/lib/std/build.zig index 85a65393e..2b7eb254e 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1132,6 +1132,7 @@ pub const LibExeObjStep = struct { name_prefix: []const u8, filter: ?[]const u8, single_threaded: bool, + evented_io: bool = false, code_model: builtin.CodeModel = .default, root_src: ?FileSource, @@ -1559,6 +1560,11 @@ pub const LibExeObjStep = struct { self.filter = text; } + pub fn setUseTestEventedIo(self: *LibExeObjStep, use_evented_io: bool) void { + assert(self.kind == Kind.Test); + self.evented_io = use_evented_io; + } + pub fn addCSourceFile(self: *LibExeObjStep, file: []const u8, args: []const []const u8) void { self.addCSourceFileSource(.{ .args = args, @@ -1864,6 +1870,10 @@ pub const LibExeObjStep = struct { try zig_args.append(filter); } + if (self.evented_io) { + try zig_args.append("--test-evented-io"); + } + if (self.name_prefix.len != 0) { try zig_args.append("--test-name-prefix"); try zig_args.append(self.name_prefix);