Skip to content

Commit 8ccf581

Browse files
authored
Add a test for installing a dependency with a specific version number (#413)
* Add a test for installing a dependency with a specific version number * Don't setup broken deps at all with Julia v1.9-10
1 parent 7c82b89 commit 8ccf581

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test/dependencies.jl

+36
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,42 @@ 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+
if v"1.9" <= VERSION < v"1.11"
380+
# For reasons I can't understand, in CI on GitHub Actions (and only
381+
# there, can't reproduce the same behaviour locally) the error thrown
382+
# inside the `setup_dependencies` "escapes" the `try` block. For lack of
383+
# time to debug this stupid thing we just mark this step as broken and
384+
# move on, it's really broken anyway.
385+
@test false broken=true
386+
else
387+
try
388+
test_setup_dependencies(prefix, dependencies, platform)
389+
catch
390+
if VERSION>=v"1.9"
391+
# This test is expected to be broken on Julia v1.9+
392+
@test false broken=true
393+
else
394+
# For previous versions we don't expect errors and we
395+
# want to see them.
396+
rethrow()
397+
end
398+
end
399+
end
400+
# The directory contains also executables from CMake dependencies.
401+
# Test will fail if `setup_dependencies` above failed.
402+
@test readdir(joinpath(destdir(dir, platform), "bin")) == ["c_rehash", "cmake", "cpack", "ctest", "openssl"] broken=VERSION>=v"1.9"
403+
end
404+
end
405+
370406
end
371407
end
372408

0 commit comments

Comments
 (0)