|
86 | 86 | prefix = Prefix(testdir)
|
87 | 87 |
|
88 | 88 | # Run ISA test
|
89 |
| - readmeta(locate(product, prefix)) do oh |
90 |
| - detected_isa = Auditor.analyze_instruction_set(oh, platform; verbose=true) |
91 |
| - @test detected_isa == "avx512" |
| 89 | + readmeta(locate(product, prefix)) do ohs |
| 90 | + foreach(ohs) do oh |
| 91 | + detected_isa = Auditor.analyze_instruction_set(oh, platform; verbose=true) |
| 92 | + @test detected_isa == "avx512" |
| 93 | + end |
92 | 94 | end
|
93 | 95 | end
|
94 | 96 | end
|
|
133 | 135 | prefix = Prefix(testdir)
|
134 | 136 |
|
135 | 137 | # Run ISA test
|
136 |
| - readmeta(locate(product, prefix)) do oh |
137 |
| - detected_march = Auditor.analyze_instruction_set(oh, platform; verbose=true) |
138 |
| - @test detected_march == "avx" |
| 138 | + readmeta(locate(product, prefix)) do ohs |
| 139 | + foreach(ohs) do oh |
| 140 | + detected_march = Auditor.analyze_instruction_set(oh, platform; verbose=true) |
| 141 | + @test detected_march == "avx" |
| 142 | + end |
139 | 143 | end
|
140 | 144 | end
|
141 | 145 | end
|
@@ -182,14 +186,16 @@ end
|
182 | 186 | prefix = Prefix(testdir)
|
183 | 187 |
|
184 | 188 | # Run ISA test
|
185 |
| - readmeta(locate(product, prefix)) do oh |
186 |
| - detected_march = Auditor.analyze_instruction_set(oh, platform; verbose=true) |
187 |
| - if march == "avx2" |
188 |
| - # Detecting the ISA isn't 100% reliable and it's even less |
189 |
| - # accurate when looking for AVX2 features |
190 |
| - @test_broken march == detected_march |
191 |
| - else |
192 |
| - @test march == detected_march |
| 189 | + readmeta(locate(product, prefix)) do ohs |
| 190 | + foreach(ohs) do oh |
| 191 | + detected_march = Auditor.analyze_instruction_set(oh, platform; verbose=true) |
| 192 | + if march == "avx2" |
| 193 | + # Detecting the ISA isn't 100% reliable and it's even less |
| 194 | + # accurate when looking for AVX2 features |
| 195 | + @test_broken march == detected_march |
| 196 | + else |
| 197 | + @test march == detected_march |
| 198 | + end |
193 | 199 | end
|
194 | 200 | end
|
195 | 201 | end
|
|
243 | 249 | prefix = Prefix(testdir)
|
244 | 250 |
|
245 | 251 | # Ensure that the library detects as the correct cxxstring_abi:
|
246 |
| - readmeta(locate(libcxxstringabi_test, prefix)) do oh |
247 |
| - detected_cxxstring_abi = Auditor.detect_cxxstring_abi(oh, platform) |
248 |
| - @test detected_cxxstring_abi == cxxstring_abi(platform) |
| 252 | + readmeta(locate(libcxxstringabi_test, prefix)) do ohs |
| 253 | + foreach(ohs) do oh |
| 254 | + detected_cxxstring_abi = Auditor.detect_cxxstring_abi(oh, platform) |
| 255 | + @test detected_cxxstring_abi == cxxstring_abi(platform) |
| 256 | + end |
249 | 257 | end
|
250 | 258 |
|
251 | 259 | # Explicitly test cxx string abi mismatches
|
@@ -404,11 +412,13 @@ end
|
404 | 412 | prefix = Prefix(testdir)
|
405 | 413 |
|
406 | 414 | # Helper to extract the dylib id of a path
|
407 |
| - function get_dylib_id(path) |
408 |
| - return readmeta(path) do oh |
409 |
| - dylib_id_lcs = [lc for lc in MachOLoadCmds(oh) if isa(lc, MachOIdDylibCmd)] |
410 |
| - @test !isempty(dylib_id_lcs) |
411 |
| - return dylib_name(first(dylib_id_lcs)) |
| 415 | + function get_dylib_ids(path) |
| 416 | + return readmeta(path) do ohs |
| 417 | + map(ohs) do oh |
| 418 | + dylib_id_lcs = [lc for lc in MachOLoadCmds(oh) if isa(lc, MachOIdDylibCmd)] |
| 419 | + @test !isempty(dylib_id_lcs) |
| 420 | + return dylib_name(first(dylib_id_lcs)) |
| 421 | + end |
412 | 422 | end
|
413 | 423 | end
|
414 | 424 |
|
|
419 | 429 | right_id_path = locate(right_id, prefix; platform=platform)
|
420 | 430 | for p in (no_id_path, abs_id_path, right_id_path)
|
421 | 431 | @test any(startswith.(p, libdirs(prefix)))
|
422 |
| - @test get_dylib_id(p) == "@rpath/$(basename(p))" |
| 432 | + @test all(get_dylib_ids(p) .== "@rpath/$(basename(p))") |
423 | 433 | end
|
424 | 434 |
|
425 | 435 | # Only if it already has an `@rpath/`-ified ID, it doesn't get touched.
|
@@ -534,10 +544,12 @@ end
|
534 | 544 | # audit should warn us.
|
535 | 545 | libgfortran_versions = (3, 4, 5)
|
536 | 546 | other_libgfortran_version = libgfortran_versions[findfirst(v -> v != our_libgfortran_version.major, libgfortran_versions)]
|
537 |
| - @test_logs (:warn, Regex("but we are supposedly building for libgfortran$(other_libgfortran_version)")) (:warn, r"Linked library libgfortran.so.5") (:warn, r"Linked library libquadmath.so.0") (:warn, r"Linked library libgcc_s.so.1") readmeta(hello_world_path) do oh |
538 |
| - p = deepcopy(platform) |
539 |
| - p["libgfortran_version"] = "$(other_libgfortran_version).0.0" |
540 |
| - @test !Auditor.audit(Prefix(testdir); platform=p, autofix=false) |
| 547 | + @test_logs (:warn, Regex("but we are supposedly building for libgfortran$(other_libgfortran_version)")) (:warn, r"Linked library libgfortran.so.5") (:warn, r"Linked library libquadmath.so.0") (:warn, r"Linked library libgcc_s.so.1") readmeta(hello_world_path) do ohs |
| 548 | + foreach(ohs) do oh |
| 549 | + p = deepcopy(platform) |
| 550 | + p["libgfortran_version"] = "$(other_libgfortran_version).0.0" |
| 551 | + @test !Auditor.audit(Prefix(testdir); platform=p, autofix=false) |
| 552 | + end |
541 | 553 | end
|
542 | 554 | end
|
543 | 555 | end
|
|
0 commit comments