Skip to content

Commit

Permalink
Our approach breaks if test/Project.toml is used
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Nov 15, 2023
1 parent 518ba56 commit 76d916a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/ambiguous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ function get_project_dict()
return project_dict
end

# If someone makes a PR to this repo to add a
# `test/Project.toml` file, then this whole approach will break.
function assert_no_test_project_toml()
root_test = @__DIR__ # ./test/
root_test_project_toml = joinpath(root_test, "Project.toml") # ./test/Project.toml
if ispath(root_test_project_toml)
error("Currently, we don't support test/Project.toml in this repo")
end
return nothing
end

function get_test_deps()
project_dict = get_project_dict()
targets_section = project_dict["targets"]
Expand Down Expand Up @@ -50,6 +61,7 @@ end
# via `Pkg.test`. Therefore, test deps must be manually
# installed if missing.
function install_all_test_deps()
assert_no_test_project_toml()
test_deps = get_test_deps()

# If all the test deps are already available,
Expand Down

0 comments on commit 76d916a

Please sign in to comment.