commit a1b123bccbc2ae50442fcc1544b0da0595401038 (tree)
parent ae0f12885bd0f6f436269a51634f56c3fe7fddc8
Author: dweiller <4678790+dweiller@users.noreplay.github.com>
Date: Sun, 13 Nov 2022 13:47:42 +1100
std.build: add setter for LibObjExeStep test runner path
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/lib/std/build.zig b/lib/std/build.zig
@@ -2207,6 +2207,11 @@ pub const LibExeObjStep = struct {
self.filter = if (text) |t| self.builder.dupe(t) else null;
}
+ pub fn setTestRunner(self: *LibExeObjStep, path: ?[]const u8) void {
+ assert(self.kind == .@"test" or self.kind == .test_exe);
+ self.test_runner = if (path) |p| self.builder.dupePath(p) else null;
+ }
+
/// Handy when you have many C/C++ source files and want them all to have the same flags.
pub fn addCSourceFiles(self: *LibExeObjStep, files: []const []const u8, flags: []const []const u8) void {
const c_source_files = self.builder.allocator.create(CSourceFiles) catch unreachable;