diff options
| author | dweiller <4678790+dweiller@users.noreplay.github.com> | 2022-10-25 16:52:29 +1100 |
|---|---|---|
| committer | dweiller <4678790+dweiller@users.noreplay.github.com> | 2022-11-02 12:54:35 +1100 |
| commit | 55c91fc42d048a18c724bdaffe3709bef8aa143e (patch) | |
| tree | 36adf282f6f3509e97a6d348ceb96a712a240608 /src/main.zig | |
| parent | ebf9ffd342a30c7c79657f5dbfc83fde0647e630 (diff) | |
| download | zig-55c91fc42d048a18c724bdaffe3709bef8aa143e.tar.gz zig-55c91fc42d048a18c724bdaffe3709bef8aa143e.zip | |
stage2: add test_runner_path for user provided test runner
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig index d0edbbed6d..4d861851c2 100644 --- a/src/main.zig +++ b/src/main.zig @@ -503,6 +503,7 @@ const usage_build_generic = \\ --test-cmd-bin Appends test binary path to test cmd args \\ --test-evented-io Runs the test in evented I/O mode \\ --test-no-exec Compiles test binary without running it + \\ --test-runner [path] Specify a custom test runner \\ \\Debug Options (Zig Compiler Development): \\ -ftime-report Print timing diagnostics @@ -726,6 +727,7 @@ fn buildOutputType( var runtime_args_start: ?usize = null; var test_filter: ?[]const u8 = null; var test_name_prefix: ?[]const u8 = null; + var test_runner_path: ?[]const u8 = null; var override_local_cache_dir: ?[]const u8 = try optionalStringEnvVar(arena, "ZIG_LOCAL_CACHE_DIR"); var override_global_cache_dir: ?[]const u8 = try optionalStringEnvVar(arena, "ZIG_GLOBAL_CACHE_DIR"); var override_lib_dir: ?[]const u8 = try optionalStringEnvVar(arena, "ZIG_LIB_DIR"); @@ -1043,6 +1045,8 @@ fn buildOutputType( test_filter = args_iter.nextOrFatal(); } else if (mem.eql(u8, arg, "--test-name-prefix")) { test_name_prefix = args_iter.nextOrFatal(); + } else if (mem.eql(u8, arg, "--test-runner")) { + test_runner_path = args_iter.nextOrFatal(); } else if (mem.eql(u8, arg, "--test-cmd")) { try test_exec_args.append(args_iter.nextOrFatal()); } else if (mem.eql(u8, arg, "--cache-dir")) { @@ -2943,6 +2947,7 @@ fn buildOutputType( .test_evented_io = test_evented_io, .test_filter = test_filter, .test_name_prefix = test_name_prefix, + .test_runner_path = test_runner_path, .disable_lld_caching = !have_enable_cache, .subsystem = subsystem, .wasi_exec_model = wasi_exec_model, |
