| ... | ... | @@ -54,6 +54,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 54 | 54 | macho_step.dependOn(testEntryPointArchive(b, .{ .target = default_target })); |
| 55 | 55 | macho_step.dependOn(testEntryPointDylib(b, .{ .target = default_target })); |
| 56 | 56 | macho_step.dependOn(testDylib(b, .{ .target = default_target })); |
| 57 | macho_step.dependOn(testDylibVersionTbd(b, .{ .target = default_target })); |
| 57 | 58 | macho_step.dependOn(testNeededLibrary(b, .{ .target = default_target })); |
| 58 | 59 | macho_step.dependOn(testSearchStrategy(b, .{ .target = default_target })); |
| 59 | 60 | macho_step.dependOn(testTbdv3(b, .{ .target = default_target })); |
| ... | ... | @@ -243,6 +244,42 @@ fn testDylib(b: *Build, opts: Options) *Step { |
| 243 | 244 | return test_step; |
| 244 | 245 | } |
| 245 | 246 | |
| 247 | fn testDylibVersionTbd(b: *Build, opts: Options) *Step { |
| 248 | const test_step = addTestStep(b, "macho-dylib-version-tbd", opts); |
| 249 | |
| 250 | const tbd = tbd: { |
| 251 | const wf = WriteFile.create(b); |
| 252 | break :tbd wf.add("liba.tbd", |
| 253 | \\--- !tapi-tbd |
| 254 | \\tbd-version: 4 |
| 255 | \\targets: [ x86_64-macos, arm64-macos ] |
| 256 | \\uuids: |
| 257 | \\ - target: x86_64-macos |
| 258 | \\ value: DEADBEEF |
| 259 | \\ - target: arm64-macos |
| 260 | \\ value: BEEFDEAD |
| 261 | \\install-name: '@rpath/liba.dylib' |
| 262 | \\current-version: 1.2 |
| 263 | \\exports: |
| 264 | \\ - targets: [ x86_64-macos, arm64-macos ] |
| 265 | \\ symbols: [ _foo ] |
| 266 | ); |
| 267 | }; |
| 268 | |
| 269 | const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes = "int main() {}" }); |
| 270 | exe.root_module.linkSystemLibrary("a", .{}); |
| 271 | exe.root_module.addLibraryPath(tbd.dirname()); |
| 272 | |
| 273 | const check = exe.checkObject(); |
| 274 | check.checkInHeaders(); |
| 275 | check.checkExact("cmd LOAD_DYLIB"); |
| 276 | check.checkExact("name @rpath/liba.dylib"); |
| 277 | check.checkExact("current version 10200"); |
| 278 | test_step.dependOn(&check.step); |
| 279 | |
| 280 | return test_step; |
| 281 | } |
| 282 | |
| 246 | 283 | fn testEmptyObject(b: *Build, opts: Options) *Step { |
| 247 | 284 | const test_step = addTestStep(b, "macho-empty-object", opts); |
| 248 | 285 | |