Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate test segfaults with the Testset scaffolding #19377

Merged
merged 1 commit into from
Nov 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ cd(dirname(@__FILE__)) do
and Brokens from the worker and the full information about all errors and
failures encountered running the tests. This information will be displayed
as a summary at the end of the test run.

If a test failed, returning an `Exception` that is not a `RemoteException`,
it is likely the julia process running the test has encountered some kind
of internal error, such as a segfault. The entire testset is marked as
Errored, and execution continues until the summary at the end of the test
run, where the test file is printed out as the "failed expression".
=#
o_ts = Base.Test.DefaultTestSet("Overall")
Base.Test.push_testset(o_ts)
Expand Down Expand Up @@ -141,6 +147,16 @@ cd(dirname(@__FILE__)) do
Base.Test.record(o_ts, fake)
Base.Test.pop_testset()
end
elseif isa(res[2][1], Exception)
# If this test raised an exception that is not a RemoteException, that means
# the test runner itself had some problem, so we may have hit a segfault
# or something similar. Record this testset as Errored.
o_ts.anynonpass = true
fake = Base.Test.DefaultTestSet(res[1])
Base.Test.record(fake, Base.Test.Error(:test_error, res[1], res[2][1], []))
Base.Test.push_testset(fake)
Base.Test.record(o_ts, fake)
Base.Test.pop_testset()
end
end
println()
Expand Down
1 change: 1 addition & 0 deletions test/util/segfault.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unsafe_load(convert(Ptr{UInt8},C_NULL))
1 change: 1 addition & 0 deletions test/util/throw_error_exception.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
error("This purposefully dies")