Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Oct 13, 2024
1 parent 98f50c7 commit 418bd08
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,18 @@ end
end
end

@testset "Fallback for stdlib deps if manifest deps aren't found" begin
mktempdir() do depot
# This manifest has a LibGit2 entry that is missing LibGit2_jll, which should be
# handled by falling back to the stdlib Project.toml for dependency truth.
badmanifest_test_dir = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps.jl")
@test success(addenv(
`$(Base.julia_cmd()) --project=$badmanifest_test_dir --startup-file=no -e 'using LibGit2'`,
"JULIA_DEPOT_PATH" => depot * Base.Filesystem.pathsep(),
))
end
end

@testset "code coverage disabled during precompilation" begin
mktempdir() do depot
cov_test_dir = joinpath(@__DIR__, "project", "deps", "CovTest.jl")
Expand Down
51 changes: 51 additions & 0 deletions test/project/deps/BadStdlibDeps/Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.12.0-DEV"
manifest_format = "2.0"
project_hash = "dc9d33b0ee13d9466bdb75b8d375808a534a79ec"

[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
version = "1.11.0"

# This is intentionally missing LibGit2_jll for testing purposes
[[deps.LibGit2]]
deps = ["NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
version = "1.11.0"

[[deps.LibGit2_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
version = "1.8.0+0"

[[deps.LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
version = "1.11.0+1"

[[deps.Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
version = "1.11.0"

[[deps.MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.28.6+1"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[deps.Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
version = "1.11.0"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[deps.Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
version = "1.11.0"
2 changes: 2 additions & 0 deletions test/project/deps/BadStdlibDeps/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"

0 comments on commit 418bd08

Please sign in to comment.