Skip to content

Commit 4586842

Browse files
fix
1 parent 2e11944 commit 4586842

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

test/precompile.jl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -686,16 +686,15 @@ precompile_test_harness(false) do dir
686686
error("break me")
687687
end
688688
""")
689-
@test_warn r"LoadError: break me\nStacktrace:\n[ ]*\[1\] [\e01m\[]*error" try
690-
Base.require(Main, :FooBar2)
691-
error("the \"break me\" test failed")
692-
catch exc
693-
isa(exc, Base.Precompilation.PkgPrecompileError) || rethrow()
694-
# The PkgPrecompileError shouldn't be surfaced but is printed to stderr, hence the `@test_warn` capture tests
695-
occursin("LoadError: break me", exc.msg) && rethrow()
696-
# The actual error that is thrown
697-
occursin("Failed to precompile FooBar2", exc.msg) || rethrow()
698-
end
689+
try
690+
Base.require(Main, :FooBar2)
691+
error("the \"break me\" test failed")
692+
catch exc
693+
isa(exc, Base.Precompilation.PkgPrecompileError) || rethrow()
694+
occursin("Failed to precompile FooBar2", exc.msg) || rethrow()
695+
# The LoadError is printed to stderr in the precompilepkgs worker and captured in the PkgPrecompileError msg
696+
occursin("LoadError: break me", exc.msg) || rethrow()
697+
end
699698

700699
# Test that trying to eval into closed modules during precompilation is an error
701700
FooBar3_file = joinpath(dir, "FooBar3.jl")

0 commit comments

Comments
 (0)