authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-02-03 19:36:52+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-02-03 19:36:52+01:00
logca86dc61ddf1f2dd96f78e217ade71f04604d144
tree4f309b31318952e621182c3ad254c76efbd839c0
parent4ebd0036fd6d1d51e8cd6693abe77c2eb2f5e743

test/link/macho: test for signals only when running on the host


1 files changed, 5 insertions(+), 3 deletions(-)

test/link/macho.zig+5-3
......@@ -1242,9 +1242,10 @@ fn testRelocatableZig(b: *Build, opts: Options) *Step {
12421242 if (opts.use_llvm) {
12431243 // TODO: enable this once self-hosted can print panics and stack traces
12441244 run.addCheck(.{ .expect_stderr_match = b.dupe("panic: Oh no!") });
1245 run.addCheck(.{ .expect_term = .{ .Signal = std.os.darwin.SIG.ABRT } });
1246 } else {
1247 run.addCheck(.{ .expect_term = .{ .Signal = std.os.darwin.SIG.TRAP } });
1245 }
1246 if (builtin.os.tag == .macos) {
1247 const signal: u32 = if (opts.use_llvm) std.os.darwin.SIG.ABRT else std.os.darwin.SIG.TRAP;
1248 run.addCheck(.{ .expect_term = .{ .Signal = signal } });
12481249 }
12491250 test_step.dependOn(&run.step);
12501251
......@@ -2318,6 +2319,7 @@ fn addTestStep(b: *Build, comptime prefix: []const u8, opts: Options) *Step {
23182319 return link.addTestStep(b, "macho-" ++ prefix, opts);
23192320}
23202321
2322const builtin = @import("builtin");
23212323const addAsmSourceBytes = link.addAsmSourceBytes;
23222324const addCSourceBytes = link.addCSourceBytes;
23232325const addRunArtifact = link.addRunArtifact;