|
439 | 439 | # the results at the end of the tests
|
440 | 440 | record(ts::DefaultTestSet, t::AbstractTestSet) = push!(ts.results, t)
|
441 | 441 |
|
442 |
| -# Called at the end of a @testset, behaviour depends on whether |
443 |
| -# this is a child of another testset, or the "root" testset |
444 |
| -function finish(ts::DefaultTestSet) |
445 |
| - # If we are a nested test set, do not print a full summary |
446 |
| - # now - let the parent test set do the printing |
447 |
| - if get_testset_depth() != 0 |
448 |
| - # Attach this test set to the parent test set |
449 |
| - parent_ts = get_testset() |
450 |
| - record(parent_ts, ts) |
451 |
| - return |
452 |
| - end |
| 442 | +function print_test_results(ts::DefaultTestSet, depth_pad=0) |
453 | 443 | # Calculate the overall number for each type so each of
|
454 | 444 | # the test result types are aligned
|
455 | 445 | passes, fails, errors, broken, c_passes, c_fails, c_errors, c_broken = get_test_counts(ts)
|
@@ -492,11 +482,25 @@ function finish(ts::DefaultTestSet)
|
492 | 482 | end
|
493 | 483 | println()
|
494 | 484 | # Recursively print a summary at every level
|
495 |
| - print_counts(ts, 0, align, pass_width, fail_width, error_width, broken_width, total_width) |
| 485 | + print_counts(ts, depth_pad, align, pass_width, fail_width, error_width, broken_width, total_width) |
| 486 | +end |
| 487 | + |
| 488 | +# Called at the end of a @testset, behaviour depends on whether |
| 489 | +# this is a child of another testset, or the "root" testset |
| 490 | +function finish(ts::DefaultTestSet) |
| 491 | + # If we are a nested test set, do not print a full summary |
| 492 | + # now - let the parent test set do the printing |
| 493 | + if get_testset_depth() != 0 |
| 494 | + # Attach this test set to the parent test set |
| 495 | + parent_ts = get_testset() |
| 496 | + record(parent_ts, ts) |
| 497 | + return |
| 498 | + end |
496 | 499 | # Finally throw an error as we are the outermost test set
|
497 |
| - if total != total_pass |
| 500 | + #print_test_results(ts) |
| 501 | + #=if total != total_pass |
498 | 502 | throw(TestSetException(total_pass,total_fail,total_error, total_broken))
|
499 |
| - end |
| 503 | + end=# |
500 | 504 |
|
501 | 505 | # return the testset so it is returned from the @testset macro
|
502 | 506 | ts
|
@@ -550,7 +554,6 @@ function print_counts(ts::DefaultTestSet, depth, align,
|
550 | 554 | # through and child test sets
|
551 | 555 | passes, fails, errors, broken, c_passes, c_fails, c_errors, c_broken = get_test_counts(ts)
|
552 | 556 | subtotal = passes + fails + errors + broken + c_passes + c_fails + c_errors + c_broken
|
553 |
| - |
554 | 557 | # Print test set header, with an alignment that ensures all
|
555 | 558 | # the test results appear above each other
|
556 | 559 | print(rpad(string(lpad(" ",depth), ts.description), align, " "), " | ")
|
|
0 commit comments