Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Apr 5, 2023
1 parent 76b6e98 commit 6114f1d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/extensions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,20 @@ using Test
Pkg.test("HasDepWithExtensions", julia_args=`--depwarn=no`) # OffsetArrays errors from depwarn
@test_throws Pkg.Resolve.ResolverError Pkg.add(; name = "OffsetArrays", version = "0.9.0")
end
isolate(loaded_depot=false) do
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0) do
depot = mktempdir(); empty!(DEPOT_PATH); push!(DEPOT_PATH, depot)
Pkg.activate(; temp=true)
Pkg.Registry.add(Pkg.RegistrySpec(path=joinpath(@__DIR__, "test_packages", "ExtensionExamples", "ExtensionRegistry")))
Pkg.Registry.add("General")
Pkg.add("HasDepWithExtensions")
end
iob = IOBuffer()
Pkg.precompile("HasDepWithExtensions", io=iob)
out = String(take!(iob))
@test occursin("Precompiling", out)
@test occursin("OffsetArraysExt", out)
@test occursin("HasExtensions", out)
@test occursin("HasDepWithExtensions", out)
end
end

0 comments on commit 6114f1d

Please sign in to comment.