@@ -3,6 +3,7 @@ using Test
3
3
using Libdl
4
4
using Pkg
5
5
using SHA
6
+ using Pkg. BinaryPlatforms
6
7
7
8
# The platform we're running on
8
9
const platform = platform_key_abi ()
28
29
29
30
@testset " OutputCollector" begin
30
31
cd (" output_tests" ) do
32
+ @info pwd ()
31
33
# Collect the output of `simple.sh``
32
34
oc = OutputCollector (` $sh ./simple.sh` )
33
35
191
193
end
192
194
193
195
# Test that we can control libdir() via platform arguments
194
- @test libdir (prefix, Linux ( : x86_64 )) == joinpath (prefix, " lib" )
195
- @test libdir (prefix, Windows ( : x86_64 )) == joinpath (prefix, " bin" )
196
+ @test libdir (prefix, Platform ( " x86_64" , " linux " )) == joinpath (prefix, " lib" )
197
+ @test libdir (prefix, Platform ( " x86_64" , " windows " )) == joinpath (prefix, " bin" )
196
198
end
197
199
end
198
200
@@ -220,19 +222,19 @@ end
220
222
@test satisfied (ef, verbose= true )
221
223
@static if ! Sys. iswindows ()
222
224
# Windows doesn't care about executable bit, grumble grumble
223
- @test ! satisfied (e, verbose= true , platform= Linux ( : x86_64 ))
225
+ @test ! satisfied (e, verbose= true , platform= Platform ( " x86_64" , " linux " ))
224
226
end
225
227
226
228
# Make it executable and ensure this does satisfy the Executable
227
229
chmod (e_path, 0o777 )
228
- @test satisfied (e, verbose= true , platform= Linux ( : x86_64 ))
230
+ @test satisfied (e, verbose= true , platform= Platform ( " x86_64" , " linux " ))
229
231
230
232
# Remove it and add a `$(path).exe` version to check again, this
231
233
# time saying it's a Windows executable
232
234
Base. rm (e_path; force= true )
233
235
touch (" $(e_path) .exe" )
234
236
chmod (" $(e_path) .exe" , 0o777 )
235
- @test locate (e, platform= Windows ( : x86_64 )) == " $(e_path) .exe"
237
+ @test locate (e, platform= Platform ( " x86_64" , " windows " )) == " $(e_path) .exe"
236
238
237
239
# Test that simply creating a library file doesn't satisfy it if we are
238
240
# testing something that matches the current platform's dynamic library
247
249
# But if it is from a different platform, simple existence will be
248
250
# enough to satisfy a LibraryProduct
249
251
@static if Sys. iswindows ()
250
- p = Linux ( : x86_64 )
252
+ p = Platform ( " x86_64" , " linux " )
251
253
mkpath (libdir (prefix, p))
252
254
l_path = joinpath (libdir (prefix, p), " libfoo.so" )
253
255
touch (l_path)
259
261
@test satisfied (ld, verbose= true , platform= p)
260
262
@test satisfied (ld, verbose= true , platform= p, isolate= true )
261
263
else
262
- p = Windows ( : x86_64 )
264
+ p = Platform ( " x86_64" , " windows " )
263
265
mkpath (libdir (prefix, p))
264
266
l_path = joinpath (libdir (prefix, p), " libfoo.dll" )
265
267
touch (l_path)
@@ -275,12 +277,12 @@ end
275
277
276
278
# Ensure that the test suite thinks that these libraries are foreign
277
279
# so that it doesn't try to `dlopen()` them:
278
- foreign_platform = if platform == Linux ( : aarch64 )
280
+ foreign_platform = if platform == Platform ( " aarch64" , " linux " )
279
281
# Arbitrary architecture that is not dlopen()'able
280
- Linux ( : powerpc64le )
282
+ Platform ( " powerpc64le" , " linux " )
281
283
else
282
- # If we're not Linux(: aarch64), then say the libraries are
283
- Linux ( : aarch64 )
284
+ # If we're not Platform(" aarch64", "linux") ), then say the libraries are
285
+ Platform ( " aarch64" , " linux " )
284
286
end
285
287
286
288
# Test for valid library name permutations
453
455
end
454
456
455
457
# Get a valid platform tarball name that is not our native platform
456
- other_platform = Linux ( : x86_64 )
457
- if BinaryProvider. platforms_match (platform, Linux ( : x86_64 ))
458
+ other_platform = Platform ( " x86_64" , " linux " )
459
+ if BinaryProvider. platforms_match (platform, Platform ( " x86_64" , " linux " ))
458
460
other_platform = MacOS ()
459
461
end
460
462
new_tarball_path = " libfoo.v1.0.0.$(triplet (other_platform)) .tar.gz"
@@ -593,22 +595,22 @@ end
593
595
# Use `build_libfoo_tarball.jl` in the BinaryBuilder.jl repository to generate more of these
594
596
const bin_prefix = " https://github.com/staticfloat/small_bin/raw/51b13b44feb2a262e2e04690bfa54d03167533f2/libfoo"
595
597
const libfoo_downloads = Dict (
596
- Linux ( : aarch64 ; libc= : glibc) => (" $bin_prefix /libfoo.aarch64-linux-gnu.tar.gz" , " 36886ac25cf5678c01fe20630b413f9354b7a3721c6a2c2043162f7ebd147ff5" ),
597
- Linux ( : armv7l ; libc= : glibc) => (" $bin_prefix /libfoo.arm-linux-gnueabihf.tar.gz" , " 147ebaeb1a722da43ee08705689aed71ac87c3c2c907af047c6721c0025ba383" ),
598
- Linux ( : powerpc64le ; libc= : glibc ) => (" $bin_prefix /libfoo.powerpc64le-linux-gnu.tar.gz" , " 5c35295ac161272ada9a77d1f6b770e30ea864e521e31853258cbc36ad4c4468" ),
599
- Linux ( : i686 ; libc= : glibc) => (" $bin_prefix /libfoo.i686-linux-gnu.tar.gz" , " 97655b6a218d61284723b6923d7c96e6a256fa68b9419d723c588aa24404b102" ),
600
- Linux ( : x86_64 ; libc= : glibc) => (" $bin_prefix /libfoo.x86_64-linux-gnu.tar.gz" , " 5208c63a9d07e592c78f541fc13caa8cd191b11e7e77b31d407237c2b13ec391" ),
601
-
602
- Linux ( : aarch64 ; libc= : musl ) => (" $bin_prefix /libfoo.aarch64-linux-musl.tar.gz" , " 81751477c1e3ee6c93e1c28ee7db2b99d1eed0d6ce86dc30d64c2e5dd4dfe88d" ),
603
- Linux ( : armv7l ; libc= : musl ) => (" $bin_prefix /libfoo.arm-linux-musleabihf.tar.gz" , " bb65aad58f2e6fc39dc9688da1bca5e8103a3a3fa67dc589debbd2e98176f0e1" ),
604
- Linux ( : i686 ; libc= : musl ) => (" $bin_prefix /libfoo.i686-linux-musl.tar.gz" , " 5f02fd1fe19f3a565fb128d3673b35c7b3214a101cef9dcbb202c0092438a87b" ),
605
- Linux ( : x86_64 ; libc= : musl ) => (" $bin_prefix /libfoo.x86_64-linux-musl.tar.gz" , " ea630600a12d2c1846bc93bcc8d9638a4991f63329205c534d93e0a3de5f641d" ),
606
-
607
- FreeBSD ( : x86_64) => (" $bin_prefix /libfoo.x86_64-unknown-freebsd11.1.tar.gz" , " 5f6edd6247b3685fa5c42c98a53d2a3e1eef6242c2bb3cdbb5fe23f538703fe4" ),
608
- MacOS ( : x86_64) => (" $bin_prefix /libfoo.x86_64-apple-darwin14.tar.gz" , " fcc268772d6f21d65b45fcf3854a3142679b78e53c7673dac26c95d6ccc89a24" ),
609
-
610
- Windows ( : i686) => (" $bin_prefix /libfoo.i686-w64-mingw32.tar.gz" , " 79181cf62ca8e0b2e0851fa0ace52f4ab335d0cad26fb7f9cd4ff356a9a96e70" ),
611
- Windows ( : x86_64) => (" $bin_prefix /libfoo.x86_64-w64-mingw32.tar.gz" , " 7f8939e9529835b83810d3ae7e2556f6e002d571f619894e54ece42ea5262b7f" ),
598
+ Platform ( " aarch64" , " linux " ; libc= " glibc" ) => (" $bin_prefix /libfoo.aarch64-linux-gnu.tar.gz" , " 36886ac25cf5678c01fe20630b413f9354b7a3721c6a2c2043162f7ebd147ff5" ),
599
+ Platform ( " armv7l" , " linux " ; libc= " glibc" ) => (" $bin_prefix /libfoo.arm-linux-gnueabihf.tar.gz" , " 147ebaeb1a722da43ee08705689aed71ac87c3c2c907af047c6721c0025ba383" ),
600
+ Platform ( " powerpc64le" , " linux " ; libc= " glibc" ) => (" $bin_prefix /libfoo.powerpc64le-linux-gnu.tar.gz" , " 5c35295ac161272ada9a77d1f6b770e30ea864e521e31853258cbc36ad4c4468" ),
601
+ Platform ( " i686" , " linux " ; libc= " glibc" ) => (" $bin_prefix /libfoo.i686-linux-gnu.tar.gz" , " 97655b6a218d61284723b6923d7c96e6a256fa68b9419d723c588aa24404b102" ),
602
+ Platform ( " x86_64" , " linux " ; libc= " glibc" ) => (" $bin_prefix /libfoo.x86_64-linux-gnu.tar.gz" , " 5208c63a9d07e592c78f541fc13caa8cd191b11e7e77b31d407237c2b13ec391" ),
603
+
604
+ Platform ( " aarch64" , " linux " ; libc= " musl" ) => (" $bin_prefix /libfoo.aarch64-linux-musl.tar.gz" , " 81751477c1e3ee6c93e1c28ee7db2b99d1eed0d6ce86dc30d64c2e5dd4dfe88d" ),
605
+ Platform ( " armv7l" , " linux " ; libc= " musl" ) => (" $bin_prefix /libfoo.arm-linux-musleabihf.tar.gz" , " bb65aad58f2e6fc39dc9688da1bca5e8103a3a3fa67dc589debbd2e98176f0e1" ),
606
+ Platform ( " i686" , " linux " ; libc= " musl" ) => (" $bin_prefix /libfoo.i686-linux-musl.tar.gz" , " 5f02fd1fe19f3a565fb128d3673b35c7b3214a101cef9dcbb202c0092438a87b" ),
607
+ Platform ( " x86_64" , " linux " ; libc= " musl" ) => (" $bin_prefix /libfoo.x86_64-linux-musl.tar.gz" , " ea630600a12d2c1846bc93bcc8d9638a4991f63329205c534d93e0a3de5f641d" ),
608
+
609
+ Platform ( " x86_64" , " freebsd " ) => (" $bin_prefix /libfoo.x86_64-unknown-freebsd11.1.tar.gz" , " 5f6edd6247b3685fa5c42c98a53d2a3e1eef6242c2bb3cdbb5fe23f538703fe4" ),
610
+ Platform ( " x86_64" , " macos " ) => (" $bin_prefix /libfoo.x86_64-apple-darwin14.tar.gz" , " fcc268772d6f21d65b45fcf3854a3142679b78e53c7673dac26c95d6ccc89a24" ),
611
+
612
+ Platform ( " i686" , " windows " ) => (" $bin_prefix /libfoo.i686-w64-mingw32.tar.gz" , " 79181cf62ca8e0b2e0851fa0ace52f4ab335d0cad26fb7f9cd4ff356a9a96e70" ),
613
+ Platform ( " x86_64" , " windows " ) => (" $bin_prefix /libfoo.x86_64-w64-mingw32.tar.gz" , " 7f8939e9529835b83810d3ae7e2556f6e002d571f619894e54ece42ea5262b7f" ),
612
614
)
613
615
614
616
# Test manually downloading and using libfoo
0 commit comments