Skip to content

Commit f797f92

Browse files
authored
Merge pull request #21087 from c42f/test_broken-finish-test-0.5
[release-0.5] Don't throw for tests which are explicitly marked broken
2 parents c282224 + aa3907c commit f797f92

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

base/test.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ function finish(ts::DefaultTestSet)
494494
# Recursively print a summary at every level
495495
print_counts(ts, 0, align, pass_width, fail_width, error_width, broken_width, total_width)
496496
# Finally throw an error as we are the outermost test set
497-
if total != total_pass
497+
if total != total_pass + total_broken
498498
throw(TestSetException(total_pass,total_fail,total_error, total_broken))
499499
end
500500

test/test.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,18 @@ end
227227
@test counter_17462_pre == 3
228228
@test counter_17462_post == 1
229229

230+
# Issue #21008
231+
ts = try
232+
@testset "@test_broken and @test_skip should not give an exception" begin
233+
@test_broken false
234+
@test_skip true
235+
@test_skip false
236+
end
237+
catch
238+
nothing # Shouldn't get here
239+
end
240+
@test typeof(ts) == Base.Test.DefaultTestSet
241+
230242
# now we're done running tests with DefaultTestSet so we can go back to STDOUT
231243
redirect_stdout(OLD_STDOUT)
232244

0 commit comments

Comments
 (0)