Skip to content

Commit be3bc9a

Browse files
authored
Only run Test.jl precompilation workload when outputting (#54045)
These types of workloads are usually only run when generating output.
1 parent 1ae41a2 commit be3bc9a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

stdlib/Test/src/precompile.jl

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
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
1+
if Base.generating_output()
2+
redirect_stdout(devnull) do
3+
@testset "example" begin
4+
@test 1 == 1
5+
@test_throws ErrorException error()
6+
@test_logs (:info, "Doing foo with n=2") @info "Doing foo with n=2"
7+
@test_broken 1 == 2
8+
@test 1 1.0000000000000001
9+
end
810
end
911
end

0 commit comments

Comments
 (0)