mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 12:27:41 +00:00
test/link/macho: test hello world in Zig
This commit is contained in:
parent
bf285c7e40
commit
0cc4dc615b
@ -10,6 +10,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
|
||||
|
||||
macho_step.dependOn(testDeadStrip(b, .{ .target = default_target }));
|
||||
macho_step.dependOn(testEntryPointDylib(b, .{ .target = default_target }));
|
||||
macho_step.dependOn(testHelloZig(b, .{ .target = default_target }));
|
||||
macho_step.dependOn(testLargeBss(b, .{ .target = default_target }));
|
||||
macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target }));
|
||||
macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target }));
|
||||
@ -163,6 +164,23 @@ fn testEntryPointDylib(b: *Build, opts: Options) *Step {
|
||||
return test_step;
|
||||
}
|
||||
|
||||
fn testHelloZig(b: *Build, opts: Options) *Step {
|
||||
const test_step = addTestStep(b, "macho-hello-zig", opts);
|
||||
|
||||
const exe = addExecutable(b, opts, .{ .name = "main", .zig_source_bytes =
|
||||
\\const std = @import("std");
|
||||
\\pub fn main() void {
|
||||
\\ std.io.getStdOut().writer().print("Hello world!\n", .{}) catch unreachable;
|
||||
\\}
|
||||
});
|
||||
|
||||
const run = addRunArtifact(exe);
|
||||
run.expectStdOutEqual("Hello world!\n");
|
||||
test_step.dependOn(&run.step);
|
||||
|
||||
return test_step;
|
||||
}
|
||||
|
||||
fn testLargeBss(b: *Build, opts: Options) *Step {
|
||||
const test_step = addTestStep(b, "macho-large-bss", opts);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user