|
1 | 1 | using BinaryBuilder.Auditor
|
2 |
| -using BinaryBuilder.Auditor: compatible_marchs |
| 2 | +using BinaryBuilder.Auditor: compatible_marchs, valid_library_path |
3 | 3 |
|
4 | 4 | # Tests for our auditing infrastructure
|
5 | 5 |
|
|
516 | 516 | @test readlink(joinpath(testdir, "lib", "libfoo.so")) == "libfoo.so.1.0.0"
|
517 | 517 | end
|
518 | 518 | end
|
| 519 | + |
| 520 | +@testset "valid_library_path" begin |
| 521 | + linux = Platform("x86_64", "linux") |
| 522 | + macos = Platform("x86_64", "macos") |
| 523 | + windows = Platform("x86_64", "windows") |
| 524 | + |
| 525 | + @test valid_library_path("/usr/libc.dylib", macos) |
| 526 | + @test !valid_library_path("/usr/libc.dylib.", macos) |
| 527 | + @test !valid_library_path("/usr/libc.dylib.1", macos) |
| 528 | + @test !valid_library_path("/usr/libc.dylib", linux) |
| 529 | + @test !valid_library_path("/usr/libc.dylib", windows) |
| 530 | + |
| 531 | + @test valid_library_path("libc.dll", windows) |
| 532 | + @test !valid_library_path("libc.dll.1", windows) |
| 533 | + @test !valid_library_path("libc.dll", linux) |
| 534 | + @test !valid_library_path("libc.dll", macos) |
| 535 | + |
| 536 | + @test valid_library_path("/usr/libc.so", linux) |
| 537 | + @test valid_library_path("/usr/libc.so.1", linux) |
| 538 | + @test valid_library_path("/usr/libc.so.1.2", linux) |
| 539 | + @test !valid_library_path("/usr/libc.so.", linux) |
| 540 | + @test !valid_library_path("/usr/libc.sot", linux) |
| 541 | + @test !valid_library_path("/usr/libc.so", macos) |
| 542 | + @test !valid_library_path("/usr/libc.so", windows) |
| 543 | +end |
0 commit comments