Skip to content

Commit e054c66

Browse files
author
KristofferC
committed
move out Test from the sysimage
1 parent bd1a664 commit e054c66

File tree

7 files changed

+18
-41
lines changed

7 files changed

+18
-41
lines changed

base/sysimg.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ let
6565
# 3-depth packages
6666
:REPL,
6767
:TOML,
68-
:Test,
6968

7069
# 4-depth packages
7170
:LibCURL,

contrib/generate_precompile.jl

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -199,39 +199,6 @@ if Libdl !== nothing
199199
"""
200200
end
201201

202-
Test = get(Base.loaded_modules,
203-
Base.PkgId(Base.UUID("8dfed614-e22c-5e08-85e1-65c5234f0b40"), "Test"),
204-
nothing)
205-
if Test !== nothing
206-
hardcoded_precompile_statements *= """
207-
precompile(Tuple{typeof(Test.do_test), Test.ExecutionResult, Any})
208-
precompile(Tuple{typeof(Test.testset_beginend_call), Tuple{String, Expr}, Expr, LineNumberNode})
209-
precompile(Tuple{Type{Test.DefaultTestSet}, String})
210-
precompile(Tuple{Type{Test.DefaultTestSet}, AbstractString})
211-
precompile(Tuple{Core.kwftype(Type{Test.DefaultTestSet}), Any, Type{Test.DefaultTestSet}, AbstractString})
212-
precompile(Tuple{typeof(Test.finish), Test.DefaultTestSet})
213-
precompile(Tuple{typeof(Test.eval_test), Expr, Expr, LineNumberNode, Bool})
214-
precompile(Tuple{typeof(Test._inferred), Expr, Module})
215-
precompile(Tuple{typeof(Test.push_testset), Test.DefaultTestSet})
216-
precompile(Tuple{typeof(Test.get_alignment), Test.DefaultTestSet, Int})
217-
precompile(Tuple{typeof(Test.get_test_result), Any, Any})
218-
precompile(Tuple{typeof(Test.do_test_throws), Test.ExecutionResult, Any, Any})
219-
precompile(Tuple{typeof(Test.print_counts), Test.DefaultTestSet, Int, Int, Int, Int, Int, Int, Int})
220-
precompile(Tuple{typeof(Test._check_testset), Type, Expr})
221-
precompile(Tuple{typeof(Test.test_expr!), Any, Any})
222-
precompile(Tuple{typeof(Test.test_expr!), Any, Any, Vararg{Any, 100}})
223-
precompile(Tuple{typeof(Test.pop_testset)})
224-
precompile(Tuple{typeof(Test.match_logs), Function, Tuple{Symbol, Regex}})
225-
precompile(Tuple{typeof(Test.match_logs), Function, Tuple{String, Regex}})
226-
precompile(Tuple{typeof(Base.CoreLogging.shouldlog), Test.TestLogger, Base.CoreLogging.LogLevel, Module, Symbol, Symbol})
227-
precompile(Tuple{typeof(Base.CoreLogging.handle_message), Test.TestLogger, Base.CoreLogging.LogLevel, String, Module, Symbol, Symbol, String, Int})
228-
precompile(Tuple{typeof(Test.detect_ambiguities), Any})
229-
precompile(Tuple{typeof(Test.collect_test_logs), Function})
230-
precompile(Tuple{typeof(Test.do_broken_test), Test.ExecutionResult, Any})
231-
precompile(Tuple{typeof(Test.record), Test.DefaultTestSet, Union{Test.Error, Test.Fail}})
232-
precompile(Tuple{typeof(Test.filter_errors), Test.DefaultTestSet})
233-
"""
234-
end
235202

236203
const JULIA_PROMPT = "julia> "
237204
const PKG_PROMPT = "pkg> "

pkgimage.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ $(eval $(call pkgimg_builder,LibCURL_jll,LibSSH2_jll nghttp2_jll MbedTLS_jll Zli
105105
$(eval $(call sysimg_builder,REPL,InteractiveUtils Markdown Sockets Unicode))
106106
$(eval $(call pkgimg_builder,SharedArrays,Distributed Mmap Random Serialization))
107107
$(eval $(call sysimg_builder,TOML,Dates))
108-
$(eval $(call sysimg_builder,Test,Logging Random Serialization InteractiveUtils))
108+
$(eval $(call pkgimg_builder,Test,Logging Random Serialization InteractiveUtils))
109109

110110
# 4-depth packages
111111
$(eval $(call sysimg_builder,LibCURL,LibCURL_jll MozillaCACerts_jll))

stdlib/Distributed/test/splitrange.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ isdefined(Main, :OffsetArrays) || @eval Main @everywhere include(joinpath($(BASE
2828
using .Main.OffsetArrays
2929

3030
oa = OffsetArray([123, -345], (-2,))
31+
32+
@everywhere using Test
3133
@sync @distributed for i in eachindex(oa)
3234
@test i (-1, 0)
3335
end

stdlib/Test/src/Test.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,5 +2096,6 @@ function _check_bitarray_consistency(B::BitArray{N}) where N
20962096
end
20972097

20982098
include("logging.jl")
2099+
include("precompile.jl")
20992100

21002101
end # module

stdlib/Test/src/precompile.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
redirect_stdout(devnull) do
2+
@testset "example" begin
3+
@test 1 == 1
4+
@test_throws ErrorException error()
5+
@test_logs (:info, "Doing foo with n=2") @info "Doing foo with n=2"
6+
@test_broken 1 == 2
7+
@test 1 1.0000000000000001
8+
end
9+
end

test/loading.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,15 +1089,14 @@ end
10891089
for (P, D, C, I, O) in Iterators.product(0:1, 0:2, 0:2, 0:1, 0:3)
10901090
julia = joinpath(Sys.BINDIR, Base.julia_exename())
10911091
script = """
1092-
using Test
10931092
let
10941093
cf = Base.CacheFlags()
10951094
opts = Base.JLOptions()
1096-
@test cf.use_pkgimages == opts.use_pkgimages == $P
1097-
@test cf.debug_level == opts.debug_level == $D
1098-
@test cf.check_bounds == opts.check_bounds == $C
1099-
@test cf.inline == opts.can_inline == $I
1100-
@test cf.opt_level == opts.opt_level == $O
1095+
cf.use_pkgimages == opts.use_pkgimages == $P || error("use_pkgimages")
1096+
cf.debug_level == opts.debug_level == $D || error("debug_level")
1097+
cf.check_bounds == opts.check_bounds == $C || error("check_bounds")
1098+
cf.inline == opts.can_inline == $I || error("inline")
1099+
cf.opt_level == opts.opt_level == $O || error("opt_level")
11011100
end
11021101
"""
11031102
cmd = `$julia $(pkgimage(P)) $(opt_level(O)) $(debug_level(D)) $(check_bounds(C)) $(inline(I)) -e $script`

0 commit comments

Comments
 (0)