Skip to content

Commit

Permalink
Bail our quicker on invalid stdlib requests.
Browse files Browse the repository at this point in the history
Also don't try to precompile them; TestEnv.jl cannot handle that.
  • Loading branch information
maleadt committed Jan 11, 2024
1 parent 744a3c7 commit a420566
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions scripts/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,21 @@ if !isfile(runtests)
error("Package $(pkg.name) did not provide a `test/runtests.jl` file")
end

is_stdlib = any(Pkg.Types.stdlibs()) do (uuid,stdlib)
name = isa(stdlib, String) ? stdlib : first(stdlib)
name == pkg.name
end
if is_stdlib
println("\n$(pkg.name) is a standard library in this Julia build.")

# we currently only support testing the embedded version of stdlib packages
if pkg.version !== nothing || pkg.url !== nothing || pkg.rev !== nothing
error("Packages that are standard libraries can only be tested using the embedded version.")
end
end


if config.precompile
if config.precompile && !is_stdlib
print("\n\n", '#'^80, "\n# Precompilation\n#\n\n")

# we run with JULIA_PKG_PRECOMPILE_AUTO=0 to avoid precompiling on Pkg.add,
Expand All @@ -133,19 +146,6 @@ end

print("\n\n", '#'^80, "\n# Testing\n#\n\n")

is_stdlib = any(Pkg.Types.stdlibs()) do (uuid,stdlib)
name = isa(stdlib, String) ? stdlib : first(stdlib)
name == pkg.name
end
if is_stdlib
println("\n$(pkg.name) is a standard library in this Julia build.")

# we currently only support testing the embedded version of stdlib packages
if pkg.version !== nothing || pkg.url !== nothing || pkg.rev !== nothing
error("Packages that are standard libraries can only be tested using the embedded version.")
end
end

t0 = cpu_time()
io0 = io_bytes()
try
Expand Down

0 comments on commit a420566

Please sign in to comment.