diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-11-18 14:47:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-18 14:47:21 +0200 |
| commit | 8082323dfd65c20328991d9a0d6740b779b26670 (patch) | |
| tree | e689d430ba34ad788499fa85dff7ad4552dcc77e /src/main.zig | |
| parent | 5f6f38ff3160c75c03ce0477904051e6d8af0c80 (diff) | |
| parent | a1b123bccbc2ae50442fcc1544b0da0595401038 (diff) | |
| download | zig-8082323dfd65c20328991d9a0d6740b779b26670.tar.gz zig-8082323dfd65c20328991d9a0d6740b779b26670.zip | |
Merge pull request #13411 from dweiller/custom-test-runner
Custom 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 d7685af72f..410414b3a3 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, |
