Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make choosetests find the test files for devved stdlibs #56558

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -678,20 +678,22 @@ end

"""
Base.runtests(tests=["all"]; ncores=ceil(Int, Sys.CPU_THREADS / 2),
exit_on_error=false, revise=false, [seed])
exit_on_error=false, revise=false, propagate_project=true, [seed])

Run the Julia unit tests listed in `tests`, which can be either a string or an array of
strings, using `ncores` processors. If `exit_on_error` is `false`, when one test
fails, all remaining tests in other files will still be run; they are otherwise discarded,
when `exit_on_error == true`.
If `revise` is `true`, the `Revise` package is used to load any modifications to `Base` or
to the standard libraries before running the tests.
If `propagate_project` is true the current project is propagated to the test environment.
If a seed is provided via the keyword argument, it is used to seed the
global RNG in the context where the tests are run; otherwise the seed is chosen randomly.
"""
function runtests(tests = ["all"]; ncores::Int = ceil(Int, Sys.CPU_THREADS / 2),
exit_on_error::Bool=false,
revise::Bool=false,
propagate_project::Bool=false,
seed::Union{BitInteger,Nothing}=nothing)
if isa(tests,AbstractString)
tests = split(tests)
Expand All @@ -706,8 +708,9 @@ function runtests(tests = ["all"]; ncores::Int = ceil(Int, Sys.CPU_THREADS / 2),
ENV2["JULIA_LOAD_PATH"] = string("@", pathsep, "@stdlib")
ENV2["JULIA_TESTS"] = "true"
delete!(ENV2, "JULIA_PROJECT")
project_flag = propagate_project ? `--project` : ``
try
run(setenv(`$(julia_cmd()) $(joinpath(Sys.BINDIR,
run(setenv(`$(julia_cmd()) $project_flag $(joinpath(Sys.BINDIR,
Base.DATAROOTDIR, "julia", "test", "runtests.jl")) $tests`, ENV2))
nothing
catch
Expand Down
5 changes: 3 additions & 2 deletions test/choosetests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ const NETWORK_REQUIRED_LIST = vcat(INTERNET_REQUIRED_LIST, ["Sockets"])
function test_path(test)
t = split(test, '/')
if t[1] in STDLIBS
pkgdir = abspath(Base.find_package(String(t[1])), "..", "..")
if length(t) == 2
return joinpath(STDLIB_DIR, t[1], "test", t[2])
return joinpath(pkgdir, "test", t[2])
else
return joinpath(STDLIB_DIR, t[1], "test", "runtests")
return joinpath(pkgdir, "test", "runtests")
end
elseif t[1] == "Compiler"
testpath = length(t) >= 2 ? t[2:end] : ("runtests",)
Expand Down