-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[ST-NNNN] Targeted Interoperability between Swift Testing and XCTest #2982
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
base: main
Are you sure you want to change the base?
Conversation
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
a8c3a7e to
b275e55
Compare
| We propose supporting the following Swift Testing APIs in XCTest: | ||
|
|
||
| - `#expect` and `#require` | ||
| - Includes [exit testing][] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Includes [exit testing][] | |
| - Includes `#expect(throws:)` | |
| - Includes [exit testing][] |
Assuming #expect(throws:) will work! If it won't work, we need to call that out too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my understanding of that API, we're catching thrown errors and recording issues if not thrown. Since we'd need to add interop support for Swift Testing Issue as part of the default #expect, it seems to me the check throws variant should work too
| usage occurs when running Swift Testing tests by turning those warnings into a | ||
| `fatalError`. | ||
|
|
||
| Configure the interoperability mode when running tests using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This environment variable affects the behaviour of XCTest API, right? Then I think we want to put it in the XCTEST_ namespace. 🤔
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
ff379e8 to
0545e6c
Compare
0545e6c to
f119329
Compare
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
| - [Expected failures][], such as `XCTExpectFailure`: marking a Swift Testing | ||
| issue in this way will generate a runtime warning issue. | ||
| - [`XCTAttachment`][XCTest attachments] | ||
| - [Issue handling traits][]: we will make our best effort to translate issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this point about traits or about issue handling in general? (Since we're not translating traits.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we're not proposing that you could attach a Swift Testing trait to an XCTest test function. This is about the issue handling trait in a Swift Testing test, and what happens when it's asked to handle a XCTAssert failure.
proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md
Outdated
Show resolved
Hide resolved
bfa4752 to
cd462e3
Compare
Draft proposal for interop between Swift Testing and XCTest.
Preview it here: https://github.com/jerryjrchen/swift-evolution/blob/swt-xct-interop/proposals/testing/NNNN-targeted-interoperability-swift-testing-and-xctest.md