Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.

Commit 960e9e9

Browse files
committed
Update platform values
1 parent 4b78c98 commit 960e9e9

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

test/runtests.jl

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ using Test
33
using Libdl
44
using Pkg
55
using SHA
6+
using Pkg.BinaryPlatforms
67

78
# The platform we're running on
89
const platform = platform_key_abi()
@@ -28,6 +29,7 @@ end
2829

2930
@testset "OutputCollector" begin
3031
cd("output_tests") do
32+
@info pwd()
3133
# Collect the output of `simple.sh``
3234
oc = OutputCollector(`$sh ./simple.sh`)
3335

@@ -191,8 +193,8 @@ end
191193
end
192194

193195
# 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")
196198
end
197199
end
198200

@@ -220,19 +222,19 @@ end
220222
@test satisfied(ef, verbose=true)
221223
@static if !Sys.iswindows()
222224
# 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"))
224226
end
225227

226228
# Make it executable and ensure this does satisfy the Executable
227229
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"))
229231

230232
# Remove it and add a `$(path).exe` version to check again, this
231233
# time saying it's a Windows executable
232234
Base.rm(e_path; force=true)
233235
touch("$(e_path).exe")
234236
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"
236238

237239
# Test that simply creating a library file doesn't satisfy it if we are
238240
# testing something that matches the current platform's dynamic library
@@ -247,7 +249,7 @@ end
247249
# But if it is from a different platform, simple existence will be
248250
# enough to satisfy a LibraryProduct
249251
@static if Sys.iswindows()
250-
p = Linux(:x86_64)
252+
p = Platform("x86_64", "linux")
251253
mkpath(libdir(prefix, p))
252254
l_path = joinpath(libdir(prefix, p), "libfoo.so")
253255
touch(l_path)
@@ -259,7 +261,7 @@ end
259261
@test satisfied(ld, verbose=true, platform=p)
260262
@test satisfied(ld, verbose=true, platform=p, isolate=true)
261263
else
262-
p = Windows(:x86_64)
264+
p = Platform("x86_64", "windows")
263265
mkpath(libdir(prefix, p))
264266
l_path = joinpath(libdir(prefix, p), "libfoo.dll")
265267
touch(l_path)
@@ -275,12 +277,12 @@ end
275277

276278
# Ensure that the test suite thinks that these libraries are foreign
277279
# so that it doesn't try to `dlopen()` them:
278-
foreign_platform = if platform == Linux(:aarch64)
280+
foreign_platform = if platform == Platform("aarch64", "linux")
279281
# Arbitrary architecture that is not dlopen()'able
280-
Linux(:powerpc64le)
282+
Platform("powerpc64le", "linux")
281283
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")
284286
end
285287

286288
# Test for valid library name permutations
@@ -453,8 +455,8 @@ end
453455
end
454456

455457
# 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"))
458460
other_platform = MacOS()
459461
end
460462
new_tarball_path = "libfoo.v1.0.0.$(triplet(other_platform)).tar.gz"
@@ -593,22 +595,22 @@ end
593595
# Use `build_libfoo_tarball.jl` in the BinaryBuilder.jl repository to generate more of these
594596
const bin_prefix = "https://github.com/staticfloat/small_bin/raw/51b13b44feb2a262e2e04690bfa54d03167533f2/libfoo"
595597
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"),
612614
)
613615

614616
# Test manually downloading and using libfoo

0 commit comments

Comments
 (0)