Skip to content

Commit 1b85590

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

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/dependencies.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,32 @@ 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 readdir(joinpath(destdir(dir, platform), "bin")) == ["c_rehash", "cmake", "cpack", "ctest", "openssl"]
393+
end
394+
end
395+
370396
end
371397
end
372398

0 commit comments

Comments
 (0)