Skip to content

Commit 5e36a3b

Browse files
KristofferCIanButterworth
authored andcommitted
move out Test from the sysimage
1 parent 4134e93 commit 5e36a3b

File tree

6 files changed

+34
-36
lines changed

6 files changed

+34
-36
lines changed

base/sysimg.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ let
6666
:REPL,
6767
:SharedArrays,
6868
:TOML,
69-
:Test,
7069

7170
# 4-depth packages
7271
: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 sysimg_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/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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
precompile(Tuple{typeof(Test.do_test), Test.ExecutionResult, Any})
2+
precompile(Tuple{typeof(Test.testset_beginend_call), Tuple{String, Expr}, Expr, LineNumberNode})
3+
precompile(Tuple{Type{Test.DefaultTestSet}, String})
4+
precompile(Tuple{Type{Test.DefaultTestSet}, AbstractString})
5+
precompile(Tuple{Core.kwftype(Type{Test.DefaultTestSet}), Any, Type{Test.DefaultTestSet}, AbstractString})
6+
precompile(Tuple{typeof(Test.finish), Test.DefaultTestSet})
7+
precompile(Tuple{typeof(Test.eval_test), Expr, Expr, LineNumberNode, Bool})
8+
precompile(Tuple{typeof(Test._inferred), Expr, Module})
9+
precompile(Tuple{typeof(Test.push_testset), Test.DefaultTestSet})
10+
precompile(Tuple{typeof(Test.get_alignment), Test.DefaultTestSet, Int})
11+
precompile(Tuple{typeof(Test.get_test_result), Any, Any})
12+
precompile(Tuple{typeof(Test.do_test_throws), Test.ExecutionResult, Any, Any})
13+
precompile(Tuple{typeof(Test.print_counts), Test.DefaultTestSet, Int, Int, Int, Int, Int, Int, Int})
14+
precompile(Tuple{typeof(Test._check_testset), Type, Expr})
15+
precompile(Tuple{typeof(Test.test_expr!), Any, Any})
16+
precompile(Tuple{typeof(Test.test_expr!), Any, Any, Vararg{Any, 100}})
17+
precompile(Tuple{typeof(Test.pop_testset)})
18+
precompile(Tuple{typeof(Test.match_logs), Function, Tuple{Symbol, Regex}})
19+
precompile(Tuple{typeof(Test.match_logs), Function, Tuple{String, Regex}})
20+
precompile(Tuple{typeof(Base.CoreLogging.shouldlog), Test.TestLogger, Base.CoreLogging.LogLevel, Module, Symbol, Symbol})
21+
precompile(Tuple{typeof(Base.CoreLogging.handle_message), Test.TestLogger, Base.CoreLogging.LogLevel, String, Module, Symbol, Symbol, String, Int})
22+
precompile(Tuple{typeof(Test.detect_ambiguities), Any})
23+
precompile(Tuple{typeof(Test.collect_test_logs), Function})
24+
precompile(Tuple{typeof(Test.do_broken_test), Test.ExecutionResult, Any})
25+
precompile(Tuple{typeof(Test.record), Test.DefaultTestSet, Union{Test.Error, Test.Fail}})
26+
precompile(Tuple{typeof(Test.filter_errors), Test.DefaultTestSet})
27+
# TODO: Check which of the explicit precompile statments above are still needed
28+
# with the workload below active.
29+
@testset "example" begin
30+
@test 1 == 1
31+
end

test/precompile.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ precompile_test_harness(false) do dir
399399
:LazyArtifacts, :LibCURL, :LibCURL_jll, :LibGit2, :Libdl, :LinearAlgebra,
400400
:Logging, :Markdown, :Mmap, :MozillaCACerts_jll, :NetworkOptions, :OpenBLAS_jll, :Pkg, :Printf,
401401
:p7zip_jll, :REPL, :Random, :SHA, :Serialization, :SharedArrays, :Sockets,
402-
:TOML, :Tar, :Test, :UUIDs, :Unicode,
402+
:TOML, :Tar, :UUIDs, :Unicode,
403403
:nghttp2_jll]
404404
),
405405
)

0 commit comments

Comments
 (0)