diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2021-05-13 11:03:44 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2021-05-13 20:31:33 +0200 |
| commit | 402264ab0e16dfdc98e861a440df9ef5db35c402 (patch) | |
| tree | 6abe6a4502e56cef173f48c8a75a09f3a83d37cb /src | |
| parent | e902c19c0e2bf7f0e9bc83b2c58d19ec024d56db (diff) | |
| download | zig-402264ab0e16dfdc98e861a440df9ef5db35c402.tar.gz zig-402264ab0e16dfdc98e861a440df9ef5db35c402.zip | |
Add experimental Darling support for cross testing macOS
* for cross testing stage2 tests, we use `darling shell` command
since the path to the tested binary is relative to cwd
* for the `zig test` command, we simply use `darling` since the
path to the binary is absolute
Diffstat (limited to 'src')
| -rw-r--r-- | src/test.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test.zig b/src/test.zig index f1cf543252..5a8adca3c7 100644 --- a/src/test.zig +++ b/src/test.zig @@ -9,6 +9,7 @@ const build_options = @import("build_options"); const enable_qemu: bool = build_options.enable_qemu; const enable_wine: bool = build_options.enable_wine; const enable_wasmtime: bool = build_options.enable_wasmtime; +const enable_darling: bool = build_options.enable_darling; const glibc_multi_install_dir: ?[]const u8 = build_options.glibc_multi_install_dir; const ThreadPool = @import("ThreadPool.zig"); const CrossTarget = std.zig.CrossTarget; @@ -899,6 +900,16 @@ pub const TestContext = struct { } else { return; // wasmtime not available; pass test. }, + + .darling => |darling_bin_name| if (enable_darling) { + try argv.append(darling_bin_name); + // Since we use relative to cwd here, we invoke darling with + // "shell" subcommand. + try argv.append("shell"); + try argv.append(exe_path); + } else { + return; // Darling not available; pass test. + }, } try comp.makeBinFileExecutable(); |
