Skip to content

Commit 32e86ad

Browse files
committed
Add a test for installing a dependency with a specific version number
1 parent 7c82b89 commit 32e86ad

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/dependencies.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,33 @@ end
367367
end
368368
end
369369
end
370+
371+
@testset "PackageSpec with version" begin
372+
# Install a dependency with a specific version number.
373+
with_temp_project() do dir
374+
prefix = Prefix(dir)
375+
dependencies = [
376+
PackageSpec(; name="CMake_jll", version = v"3.24.3")
377+
]
378+
platform = Platform("x86_64", "linux"; libc="musl", cxxstring_abi="cxx11")
379+
try
380+
test_setup_dependencies(prefix, dependencies, platform)
381+
catch
382+
if VERSION>=v"1.9"
383+
# This test is expected to be broken on Julia v1.9+
384+
@test false
385+
else
386+
# For previous versions we don't expect errors and we
387+
# want to see them.
388+
rethrow()
389+
end
390+
end
391+
# The directory contains also executables from CMake dependencies.
392+
# Test will fail if `setup_dependencies` above failed.
393+
@test readdir(joinpath(destdir(dir, platform), "bin")) == ["c_rehash", "cmake", "cpack", "ctest", "openssl"] broken=VERSION>=v"1.9"
394+
end
395+
end
396+
370397
end
371398
end
372399

0 commit comments

Comments
 (0)