| ... | @@ -10,6 +10,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { | ... | @@ -10,6 +10,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 10 | | 10 | |
| 11 | macho_step.dependOn(testDeadStrip(b, .{ .target = default_target })); | 11 | macho_step.dependOn(testDeadStrip(b, .{ .target = default_target })); |
| 12 | macho_step.dependOn(testEntryPointDylib(b, .{ .target = default_target })); | 12 | macho_step.dependOn(testEntryPointDylib(b, .{ .target = default_target })); |
| | 13 | macho_step.dependOn(testHelloZig(b, .{ .target = default_target })); |
| 13 | macho_step.dependOn(testLargeBss(b, .{ .target = default_target })); | 14 | macho_step.dependOn(testLargeBss(b, .{ .target = default_target })); |
| 14 | macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target })); | 15 | macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target })); |
| 15 | macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target })); | 16 | macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target })); |
| ... | @@ -163,6 +164,23 @@ fn testEntryPointDylib(b: *Build, opts: Options) *Step { | ... | @@ -163,6 +164,23 @@ fn testEntryPointDylib(b: *Build, opts: Options) *Step { |
| 163 | return test_step; | 164 | return test_step; |
| 164 | } | 165 | } |
| 165 | | 166 | |
| | 167 | fn testHelloZig(b: *Build, opts: Options) *Step { |
| | 168 | const test_step = addTestStep(b, "macho-hello-zig", opts); |
| | 169 | |
| | 170 | const exe = addExecutable(b, opts, .{ .name = "main", .zig_source_bytes = |
| | 171 | \\const std = @import("std"); |
| | 172 | \\pub fn main() void { |
| | 173 | \\ std.io.getStdOut().writer().print("Hello world!\n", .{}) catch unreachable; |
| | 174 | \\} |
| | 175 | }); |
| | 176 | |
| | 177 | const run = addRunArtifact(exe); |
| | 178 | run.expectStdOutEqual("Hello world!\n"); |
| | 179 | test_step.dependOn(&run.step); |
| | 180 | |
| | 181 | return test_step; |
| | 182 | } |
| | 183 | |
| 166 | fn testLargeBss(b: *Build, opts: Options) *Step { | 184 | fn testLargeBss(b: *Build, opts: Options) *Step { |
| 167 | const test_step = addTestStep(b, "macho-large-bss", opts); | 185 | const test_step = addTestStep(b, "macho-large-bss", opts); |
| 168 | | 186 | |