Skip to content

Commit

Permalink
linker tests: add missing dependOn calls for CheckObject steps
Browse files Browse the repository at this point in the history
  • Loading branch information
kcbanner authored and kubkon committed Jul 13, 2023
1 parent f2d433a commit 3ec3374
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/link/macho/dead_strip/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub fn build(b: *std.Build) void {
const check = exe.checkObject();
check.checkInSymtab();
check.checkNext("{*} (__TEXT,__text) external _iAmUnused");
test_step.dependOn(&check.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand All @@ -31,6 +32,7 @@ pub fn build(b: *std.Build) void {
const check = exe.checkObject();
check.checkInSymtab();
check.checkNotPresent("{*} (__TEXT,__text) external _iAmUnused");
test_step.dependOn(&check.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/dylib/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize

check_exe.checkStart("cmd RPATH");
check_exe.checkNextFileSource("path", dylib.getOutputDirectorySource());
test_step.dependOn(&check_exe.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/entry/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
check_exe.checkNext("{n_value} (__TEXT,__text) external _non_main");

check_exe.checkComputeCompare("vmaddr entryoff +", .{ .op = .eq, .value = .{ .variable = "n_value" } });
test_step.dependOn(&check_exe.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/entry_in_dylib/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
.op = .eq,
.value = .{ .variable = "stubs_vmaddr" }, // The entrypoint should be a synthetic stub
});
test_step.dependOn(&check_exe.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/needed_library/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
const check = exe.checkObject();
check.checkStart("cmd LOAD_DYLIB");
check.checkNext("name @rpath/liba.dylib");
test_step.dependOn(&check.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/search_strategy/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
const check = exe.checkObject();
check.checkStart("cmd LOAD_DYLIB");
check.checkNext("name @rpath/libsearch_dylibs_first.dylib");
test_step.dependOn(&check.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/stack_size/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
const check_exe = exe.checkObject();
check_exe.checkStart("cmd MAIN");
check_exe.checkNext("stacksize 100000000");
test_step.dependOn(&check_exe.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/strict_validation/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
},
else => unreachable,
}
test_step.dependOn(&check_exe.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/unwind_info/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ fn testUnwindInfo(

check.checkInSymtab();
check.checkNext("{*} (__TEXT,__text) external ___gxx_personality_v0");
test_step.dependOn(&check.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down
1 change: 1 addition & 0 deletions test/link/macho/weak_library/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize

check.checkInSymtab();
check.checkNext("(undefined) weak external _asStr (from liba)");
test_step.dependOn(&check.step);

const run = b.addRunArtifact(exe);
run.skip_foreign_checks = true;
Expand Down

0 comments on commit 3ec3374

Please sign in to comment.