authorgravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2022-11-01 11:57:43+11:00
committergravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2022-11-02 19:45:23+11:00
log33a401dd603ec76805ebb5c933fe41f1dfeabd5b
treeee72b87dc3eee618a534ffe855f60c00a63f501e
parent55c91fc42d048a18c724bdaffe3709bef8aa143e

std.build: add support for custom test runner


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

lib/std/build.zig+7
...@@ -1509,6 +1509,7 @@ pub const LibExeObjStep = struct {...@@ -1509,6 +1509,7 @@ pub const LibExeObjStep = struct {
1509 name_prefix: []const u8,1509 name_prefix: []const u8,
1510 filter: ?[]const u8,1510 filter: ?[]const u8,
1511 test_evented_io: bool = false,1511 test_evented_io: bool = false,
1512 test_runner: ?[]const u8,
1512 code_model: std.builtin.CodeModel = .default,1513 code_model: std.builtin.CodeModel = .default,
1513 wasi_exec_model: ?std.builtin.WasiExecModel = null,1514 wasi_exec_model: ?std.builtin.WasiExecModel = null,
1514 /// Symbols to be exported when compiling to wasm1515 /// Symbols to be exported when compiling to wasm
...@@ -1772,6 +1773,7 @@ pub const LibExeObjStep = struct {...@@ -1772,6 +1773,7 @@ pub const LibExeObjStep = struct {
1772 .exec_cmd_args = null,1773 .exec_cmd_args = null,
1773 .name_prefix = "",1774 .name_prefix = "",
1774 .filter = null,1775 .filter = null,
1776 .test_runner = null,
1775 .disable_stack_probing = false,1777 .disable_stack_probing = false,
1776 .disable_sanitize_c = false,1778 .disable_sanitize_c = false,
1777 .sanitize_thread = false,1779 .sanitize_thread = false,
...@@ -2670,6 +2672,11 @@ pub const LibExeObjStep = struct {...@@ -2670,6 +2672,11 @@ pub const LibExeObjStep = struct {
2670 try zig_args.append(self.name_prefix);2672 try zig_args.append(self.name_prefix);
2671 }2673 }
26722674
2675 if (self.test_runner) |test_runner| {
2676 try zig_args.append("--test-runner");
2677 try zig_args.append(builder.pathFromRoot(test_runner));
2678 }
2679
2673 for (builder.debug_log_scopes) |log_scope| {2680 for (builder.debug_log_scopes) |log_scope| {
2674 try zig_args.append("--debug-log");2681 try zig_args.append("--debug-log");
2675 try zig_args.append(log_scope);2682 try zig_args.append(log_scope);