Skip to content

<rdar://problem/24814424> Add unit tests for the error handling suppo… #1578

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

Merged
merged 1 commit into from
Mar 8, 2016
Merged

Conversation

mike-ferris
Copy link
Contributor

What's in this pull request?

This pull request adds some tests for the new functionality added recently to allow XCTest to work with swift error handling. There are three main functional additions to the overlay in support of error handling.

  • XCTAssertThrowsError() was added to allow explicit testing of APIs expected to throw.
  • The other XCTAssert...() functions were changed to allow their expressions to throw. If an expression to one of these other expressions does throw, it is treated as an unexpected test failure. (This just allows reducing the boilerplate when testing APIs that can throw but are not expected to.)
  • Test methods themselves are allowed to be declared as throwing. Errors thrown from a test method are also treated as an unexpected test failure. (This is also in service of reducing boilerplate.)

The tests added cover the first two cases. The third case is covered by a test that is currently commented out because it relies on features of Xcode 7.3's XCTest and Xcode 7.3 is not GM yet. (That test can be uncommented and run if you are using one of the seeds of Xcode 7.3 but will crash when run with Xcode 7.2.)

Resolved bug number:

rdar://problem/24814424 Add unit tests for the error handling support in the XCTest swift overlay


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

@mike-ferris
Copy link
Contributor Author

@swift-ci please test

@mike-ferris
Copy link
Contributor Author

The linux tests are generally busted, and these changes aren't for Linux. OS X tests look good.

mike-ferris pushed a commit that referenced this pull request Mar 8, 2016
<rdar://problem/24814424> Add unit tests for the error handling suppo…
@mike-ferris mike-ferris merged commit c237762 into swiftlang:master Mar 8, 2016
kateinoigakukun pushed a commit to kateinoigakukun/swift that referenced this pull request Sep 7, 2020
[pull] swiftwasm-release/5.3 from release/5.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant