Skip to content

Commit 92595ec

Browse files
Add more tests for BinaryBuilder usage (#4156)
1 parent c54ee59 commit 92595ec

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

test/historical_stdlib_version.jl

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,37 @@ isolate(loaded_depot=true) do
302302
end
303303

304304
@testset "julia_version = nothing" begin
305-
Pkg.activate(temp=true)
306-
# Stdlib add (impossible constraints due to julia version compat, so
307-
# must pass `julia_version=nothing`). In this case, we always fully
308-
# specify versions, but if we don't, it's okay to just give us whatever
309-
# the resolver prefers
310-
Pkg.add([
311-
PackageSpec(;name="OpenBLAS_jll", version=v"0.3.13"),
312-
PackageSpec(;name="libblastrampoline_jll", version=v"5.1.1"),
313-
]; julia_version=nothing)
314-
@test v"0.3.14" > Pkg.dependencies()[OpenBLAS_jll_UUID].version >= v"0.3.13"
315-
@test v"5.1.2" > Pkg.dependencies()[libblastrampoline_jll_UUID].version >= v"5.1.1"
305+
@testset "stdlib add" begin
306+
Pkg.activate(temp=true)
307+
# Stdlib add (impossible constraints due to julia version compat, so
308+
# must pass `julia_version=nothing`). In this case, we always fully
309+
# specify versions, but if we don't, it's okay to just give us whatever
310+
# the resolver prefers
311+
Pkg.add([
312+
PackageSpec(;name="OpenBLAS_jll", version=v"0.3.13"),
313+
PackageSpec(;name="libblastrampoline_jll", version=v"5.1.1"),
314+
]; julia_version=nothing)
315+
@test v"0.3.14" > Pkg.dependencies()[OpenBLAS_jll_UUID].version >= v"0.3.13"
316+
@test v"5.1.2" > Pkg.dependencies()[libblastrampoline_jll_UUID].version >= v"5.1.1"
317+
end
318+
@testset "non-stdlib JLL add" begin
319+
platform = Platform("x86_64", "linux"; libc="musl")
320+
# specific version vs. compat spec
321+
@testset for version in (v"3.24.3+0", "3.24.3")
322+
dependencies = [PackageSpec(; name="CMake_jll", version = version)]
323+
@testset "with context (using private Pkg.add method)" begin
324+
Pkg.activate(temp=true)
325+
ctx = Pkg.Types.Context(; julia_version=nothing)
326+
mydeps = deepcopy(dependencies)
327+
foreach(Pkg.API.handle_package_input!, mydeps)
328+
Pkg.add(ctx, mydeps; platform)
329+
end
330+
@testset "with julia_version" begin
331+
Pkg.activate(temp=true)
332+
Pkg.add(deepcopy(dependencies); platform, julia_version=nothing)
333+
end
334+
end
335+
end
316336
end
317337
HistoricalStdlibVersions.unregister!()
318338
end

0 commit comments

Comments
 (0)