Skip to content

Commit fd4cba7

Browse files
clean up Base.runtests failure print
1 parent 4d04bb6 commit fd4cba7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

base/util.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,12 +719,16 @@ function runtests(tests = ["all"]; ncores::Int = ceil(Int, Sys.EFFECTIVE_CPU_THR
719719
Base.DATAROOTDIR, "julia", "test", "runtests.jl")) $tests`, ENV2))
720720
nothing
721721
catch
722-
buf = PipeBuffer()
723-
let InteractiveUtils = Base.require_stdlib(PkgId(UUID(0xb77e0a4c_d291_57a0_90e8_8db25a27a240), "InteractiveUtils"))
724-
@invokelatest InteractiveUtils.versioninfo(buf)
722+
# evaluate versioninfo in the test environment so the listed env vars are the same
723+
vinfo = read(setenv(`$(julia_cmd()) -e 'let InteractiveUtils = Base.require_stdlib(Base.PkgId(Base.UUID(0xb77e0a4c_d291_57a0_90e8_8db25a27a240), "InteractiveUtils")); InteractiveUtils.versioninfo(); end'`, ENV2), String)
724+
msg = "A test has failed. Please submit a bug report (https://github.com/JuliaLang/julia/issues)\n" *
725+
"including error messages above and the output of versioninfo():\n$(vinfo)"
726+
if isinteractive()
727+
error(msg)
728+
else
729+
print(stderr, "ERROR: ", msg)
730+
exit(1)
725731
end
726-
error("A test has failed. Please submit a bug report (https://github.com/JuliaLang/julia/issues)\n" *
727-
"including error messages above and the output of versioninfo():\n$(read(buf, String))")
728732
end
729733
end
730734

0 commit comments

Comments
 (0)