diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2024-02-03 19:36:52 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2024-02-03 19:36:52 +0100 |
| commit | ca86dc61ddf1f2dd96f78e217ade71f04604d144 (patch) | |
| tree | 4f309b31318952e621182c3ad254c76efbd839c0 /test | |
| parent | 4ebd0036fd6d1d51e8cd6693abe77c2eb2f5e743 (diff) | |
| download | zig-ca86dc61ddf1f2dd96f78e217ade71f04604d144.tar.gz zig-ca86dc61ddf1f2dd96f78e217ade71f04604d144.zip | |
test/link/macho: test for signals only when running on the host
Diffstat (limited to 'test')
| -rw-r--r-- | test/link/macho.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/link/macho.zig b/test/link/macho.zig index fecbdae26c..7bc83b2276 100644 --- a/test/link/macho.zig +++ b/test/link/macho.zig @@ -1242,9 +1242,10 @@ fn testRelocatableZig(b: *Build, opts: Options) *Step { if (opts.use_llvm) { // TODO: enable this once self-hosted can print panics and stack traces run.addCheck(.{ .expect_stderr_match = b.dupe("panic: Oh no!") }); - run.addCheck(.{ .expect_term = .{ .Signal = std.os.darwin.SIG.ABRT } }); - } else { - run.addCheck(.{ .expect_term = .{ .Signal = std.os.darwin.SIG.TRAP } }); + } + if (builtin.os.tag == .macos) { + const signal: u32 = if (opts.use_llvm) std.os.darwin.SIG.ABRT else std.os.darwin.SIG.TRAP; + run.addCheck(.{ .expect_term = .{ .Signal = signal } }); } test_step.dependOn(&run.step); @@ -2318,6 +2319,7 @@ fn addTestStep(b: *Build, comptime prefix: []const u8, opts: Options) *Step { return link.addTestStep(b, "macho-" ++ prefix, opts); } +const builtin = @import("builtin"); const addAsmSourceBytes = link.addAsmSourceBytes; const addCSourceBytes = link.addCSourceBytes; const addRunArtifact = link.addRunArtifact; |
