link-tests: fix dumping of LOAD_DYLIB: name instead of path field

This commit is contained in:
Jakub Konka 2022-06-22 10:40:10 +02:00
parent 23a63f4ce4
commit 211de9b63b
3 changed files with 9 additions and 5 deletions

View File

@ -320,7 +320,7 @@ const MachODumper = struct {
const dylib = lc.dylib.inner.dylib;
try writer.writeByte('\n');
try writer.print(
\\path {s}
\\name {s}
\\timestamp {d}
\\current version {x}
\\compatibility version {x}

View File

@ -15,7 +15,7 @@ pub fn build(b: *Builder) void {
const check_dylib = dylib.checkObject(.macho);
check_dylib.check("cmd ID_DYLIB");
check_dylib.checkNext("path @rpath/liba.dylib");
check_dylib.checkNext("name @rpath/liba.dylib");
check_dylib.checkNext("timestamp 2");
check_dylib.checkNext("current version 10000");
check_dylib.checkNext("compatibility version 10000");
@ -32,7 +32,7 @@ pub fn build(b: *Builder) void {
const check_exe = exe.checkObject(.macho);
check_exe.check("cmd LOAD_DYLIB");
check_exe.checkNext("path @rpath/liba.dylib");
check_exe.checkNext("name @rpath/liba.dylib");
check_exe.checkNext("timestamp 2");
check_exe.checkNext("current version 10000");
check_exe.checkNext("compatibility version 10000");

View File

@ -11,10 +11,14 @@ pub fn build(b: *Builder) void {
exe.addCSourceFile("main.c", &[0][]const u8{});
exe.setBuildMode(mode);
exe.linkLibC();
// TODO when we figure out how to ship framework stubs for cross-compilation,
// populate paths to the sysroot here.
exe.linkFramework("Cocoa");
const check = exe.checkObject(.macho);
check.check("cmd LOAD_DYLIB");
check.checkNext("name /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa");
test_step.dependOn(&check.step);
const run_cmd = exe.run();
test_step.dependOn(&run_cmd.step);
}