11using JLLWrappers
2- using Pkg, Preferences
2+ using Pkg
33using Test
44
5+ @static if VERSION >= v " 1.6.0-DEV"
6+ using Preferences
7+ end
8+
59module TestJLL end
610
711@testset " JLLWrappers.jl" begin
812 mktempdir () do dir
913 Pkg. activate (dir)
1014
1115 # Prepare some overrides for various products
12- set_preferences! (joinpath (dir, " LocalPreferences.toml" ), " Vulkan_Headers_jll" , " vulkan_hpp_path" => " foo" )
13- set_preferences! (joinpath (dir, " LocalPreferences.toml" ), " HelloWorldC_jll" , " goodbye_world" => " goodbye" )
14- set_preferences! (joinpath (dir, " LocalPreferences.toml" ), " OpenLibm_jll" , " libnonexisting_path" => " libreallynonexisting" )
16+ @static if VERSION >= v " 1.6.0-DEV"
17+ set_preferences! (joinpath (dir, " LocalPreferences.toml" ), " Vulkan_Headers_jll" , " vulkan_hpp_path" => " foo" )
18+ set_preferences! (joinpath (dir, " LocalPreferences.toml" ), " HelloWorldC_jll" , " goodbye_world" => " goodbye" )
19+ set_preferences! (joinpath (dir, " LocalPreferences.toml" ), " OpenLibm_jll" , " libnonexisting_path" => " libreallynonexisting" )
20+ end
1521
1622 # Package with a FileProduct
1723 Pkg. develop (PackageSpec (path= joinpath (@__DIR__ , " Vulkan_Headers_jll" )))
@@ -20,9 +26,15 @@ module TestJLL end
2026 @test isfile (@eval TestJLL vk_xml)
2127 @test isfile (@eval TestJLL Vulkan_Headers_jll. vk_xml_path)
2228 @test isfile (@eval TestJLL Vulkan_Headers_jll. get_vk_xml_path ())
23- @test ! isfile (@eval TestJLL vulkan_hpp)
24- @test ! isfile (@eval TestJLL Vulkan_Headers_jll. vulkan_hpp_path)
25- @test ! isfile (@eval TestJLL Vulkan_Headers_jll. get_vulkan_hpp_path ())
29+ @static if VERSION >= v " 1.6.0-DEV"
30+ @test ! isfile (@eval TestJLL vulkan_hpp)
31+ @test ! isfile (@eval TestJLL Vulkan_Headers_jll. vulkan_hpp_path)
32+ @test ! isfile (@eval TestJLL Vulkan_Headers_jll. get_vulkan_hpp_path ())
33+ else
34+ @test isfile (@eval TestJLL vulkan_hpp)
35+ @test isfile (@eval TestJLL Vulkan_Headers_jll. vulkan_hpp_path)
36+ @test isfile (@eval TestJLL Vulkan_Headers_jll. get_vulkan_hpp_path ())
37+ end
2638 @test isdir (@eval TestJLL Vulkan_Headers_jll. artifact_dir)
2739 @test isempty (@eval TestJLL Vulkan_Headers_jll. PATH[])
2840 @test occursin (Sys. BINDIR, @eval TestJLL Vulkan_Headers_jll. LIBPATH[])
@@ -42,6 +54,11 @@ module TestJLL end
4254 @test occursin (Sys. BINDIR, @eval TestJLL HelloWorldC_jll. LIBPATH[])
4355 @test ! isfile (@eval TestJLL HelloWorldC_jll. goodbye_world_path)
4456 @test ! isfile (@eval TestJLL HelloWorldC_jll. get_goodbye_world_path ())
57+ @static if VERSION >= v " 1.6.0-DEV"
58+ @test basename (@eval TestJLL HelloWorldC_jll. get_goodbye_world_path ()) == " goodbye"
59+ else
60+ @test basename (@eval TestJLL HelloWorldC_jll. get_goodbye_world_path ()) == " goodbye_world"
61+ end
4562 end
4663
4764 # Package with a LibraryProduct
@@ -55,7 +72,12 @@ module TestJLL end
5572 @test isempty (@eval TestJLL OpenLibm_jll. PATH[])
5673 @test occursin (Sys. BINDIR, @eval TestJLL OpenLibm_jll. LIBPATH[])
5774 @test C_NULL == @eval TestJLL OpenLibm_jll. libnonexisting_handle
58- @test @eval TestJLL OpenLibm_jll. libnonexisting_path == " libreallynonexisting"
75+
76+ @static if VERSION >= v " 1.6.0-DEV"
77+ @test @eval TestJLL OpenLibm_jll. libnonexisting_path == " libreallynonexisting"
78+ else
79+ @test startswith (basename (@eval TestJLL OpenLibm_jll. libnonexisting_path), " libnonexisting" )
80+ end
5981
6082 # Issue #20
6183 if Sys. iswindows ()
0 commit comments