Commit 2691517
authored
Include a note after Swift Testing tests finish if any XCTests failed (#9646)
This adds a note in the console output after Swift Testing tests finish
if one or more XCTests failed, so the user knows to look earlier in the
log output for those details.
Fixes rdar://168311253
### Motivation:
Swift Package Manager runs XCTests followed by Swift Testing tests, and
they are separate subprocess invocations. Each test framework prints its
own output to the console and each has a summary at the end, which
includes the total number of failures. Since Swift Testing finishes
second (assuming both frameworks are enabled), its summary always
appears at the bottom and it can potentially be misleading to a user if
there were one or more XCTest failures but zero Swift Testing failures
because they may incorrectly believe zero tests failed overall.
Long-term, we are planning to unify the console output between these
testing frameworks so that they present a consolidated summary. However,
that remains an ambition that is still being planned and will likely
take time to arrive.
Another motivator for this is that soon, I anticipate we'll land an
enhancement in Swift Testing which will expand its failure summary to
span more lines and make it easier for users to locate which Swift
Testing tests failed. (For details, see
swiftlang/swift-testing#1420.) This will be
helpful, but also has the potential to exacerbate the pre-existing
confusion situation if (say) a mixture of Swift Testing and XCTests
failed.
### Modifications:
Modify the `swift test` command such that if Swift Testing is enabled,
it will keep track of whether any XCTests failed before running Swift
Testing, and if any did, emit a note at the very end (after Swift
Testing finishes) indicating that to the user.
### Result:
When relevant, the new note described above will be included in the
console output.1 parent 02dc656 commit 2691517
2 files changed
Lines changed: 123 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
| |||
359 | 366 | | |
360 | 367 | | |
361 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
362 | 372 | | |
363 | 373 | | |
364 | 374 | | |
| |||
377 | 387 | | |
378 | 388 | | |
379 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
380 | 399 | | |
381 | 400 | | |
382 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
737 | 841 | | |
738 | 842 | | |
739 | 843 | | |
| |||
0 commit comments