Skip to content

Commit

Permalink
test debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Jan 6, 2024
1 parent b630644 commit eb19da1
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions test/installation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,44 @@ const RCALL_DIR = dirname(@__DIR__)
function test_installation(file, project=mktempdir())
path = joinpath(@__DIR__, "installation", file)
cmd = `$(Base.julia_cmd()) --project=$(project) $(path)`
return @test success(Cmd(cmd; env=Dict("RCALL_DIR" => RCALL_DIR)))
end

mktempdir() do dir
@testset "No R" begin
test_installation("rcall_without_r.jl", dir)
end
# We want to guard this with a version check so we don't run into the following
# (non-widespread) issue on older versions of Julia:
# https://github.com/JuliaLang/julia/issues/34276
# (related to incompatible libstdc++ versions)
@static if VERSION v"1.9"
@testset "Preferences" begin
test_installation("swap_to_prefs_and_condapkg.jl", dir)
cmd = Cmd(cmd; env=Dict("RCALL_DIR" => RCALL_DIR))
@test mktemp() do file, io
try
result = run(pipeline(cmd; stdout=io, stderr=io))
return success(result)
catch
@error open(f -> read(f, String), file)
return false
end
end
end
end

# Test whether we can install RCall with Conda, and then switch to using
# Preferences + CondaPkg
mktempdir() do dir
@testset "Conda" begin
test_installation("install_conda.jl", dir)
@testset "No R" begin
test_installation("rcall_without_r.jl", dir)
end
# We want to guard this with a version check so we don't run into the following
# (non-widespread) issue on older versions of Julia:
# https://github.com/JuliaLang/julia/issues/34276
# (related to incompatible libstdc++ versions)
@static if VERSION v"1.9"
@testset "Preferences" begin
test_installation("swap_to_prefs_and_condapkg.jl", dir)
end
end
end

# We want to guard this with a version check so we don't run into the following
# issue on older versions of Julia:
# https://github.com/JuliaLang/julia/issues/34276
# (related to incompatible libstdc++ versions)
@static if VERSION v"1.9"
# Test whether we can install RCall with Conda, and then switch to using
# Preferences + CondaPkg
mktempdir() do dir
@testset "Conda" begin
test_installation("install_conda.jl", dir)
end
@testset "Conda 2 Preferences" begin
test_installation("swap_to_prefs_and_condapkg.jl", dir)
end
Expand Down

0 comments on commit eb19da1

Please sign in to comment.