@@ -1000,24 +1000,37 @@ end
1000
1000
try
1001
1001
tmp = mktempdir ()
1002
1002
push! (empty! (DEPOT_PATH ), joinpath (tmp, " depot" ))
1003
-
1004
1003
proj = joinpath (@__DIR__ , " project" , " Extensions" , " HasDepWithExtensions.jl" )
1005
- for compile in (` --compiled-modules=no` , ` ` , ` ` ) # Once when requiring precomilation, once where it is already precompiled
1006
- cmd = ` $(Base. julia_cmd ()) $compile --project=$proj --startup-file=no -e '
1007
- begin
1008
- using HasExtensions
1009
- # Base.get_extension(HasExtensions, :Extension) === nothing || error("unexpectedly got an extension")
1010
- HasExtensions.ext_loaded && error("ext_loaded set")
1011
- using HasDepWithExtensions
1012
- # Base.get_extension(HasExtensions, :Extension).extvar == 1 || error("extvar in Extension not set")
1013
- HasExtensions.ext_loaded || error("ext_loaded not set")
1014
- HasExtensions.ext_folder_loaded && error("ext_folder_loaded set")
1015
- HasDepWithExtensions.do_something() || error("do_something errored")
1016
- using ExtDep2
1017
- HasExtensions.ext_folder_loaded || error("ext_folder_loaded not set")
1018
1004
1005
+ function gen_extension_cmd (compile)
1006
+ ``` $(Base. julia_cmd ()) $compile --startup-file=no -e '
1007
+ begin
1008
+ using HasExtensions
1009
+ # Base.get_extension(HasExtensions, :Extension) === nothing || error("unexpectedly got an extension")
1010
+ HasExtensions.ext_loaded && error("ext_loaded set")
1011
+ using HasDepWithExtensions
1012
+ # Base.get_extension(HasExtensions, :Extension).extvar == 1 || error("extvar in Extension not set")
1013
+ HasExtensions.ext_loaded || error("ext_loaded not set")
1014
+ HasExtensions.ext_folder_loaded && error("ext_folder_loaded set")
1015
+ HasDepWithExtensions.do_something() || error("do_something errored")
1016
+ using ExtDep2
1017
+ HasExtensions.ext_folder_loaded || error("ext_folder_loaded not set")
1019
1018
end
1020
- '`
1019
+ '
1020
+ ```
1021
+ end
1022
+
1023
+ for compile in (` --compiled-modules=no` , ` ` , ` ` ) # Once when requiring precomilation, once where it is already precompiled
1024
+ cmd = gen_extension_cmd (compile)
1025
+ withenv (" JULIA_LOAD_PATH" => proj) do
1026
+ @test success (cmd)
1027
+ end
1028
+ end
1029
+
1030
+ # 48351
1031
+ sep = Sys. iswindows () ? ' ;' : ' :'
1032
+ withenv (" JULIA_LOAD_PATH" => join ([mktempdir (), proj], sep)) do
1033
+ cmd = gen_extension_cmd (` ` )
1021
1034
@test success (cmd)
1022
1035
end
1023
1036
finally
0 commit comments