Clone this repo:
  1. 2674f2f Merge pull request #204 from tiagomartinho/master by Brian Gesiak · 7 years ago main master upstream/master upstream/upstream/master swift-DEVELOPMENT-SNAPSHOT-2017-10-20-a swift-DEVELOPMENT-SNAPSHOT-2017-10-21-a swift-DEVELOPMENT-SNAPSHOT-2017-10-22-a swift-DEVELOPMENT-SNAPSHOT-2017-10-23-a swift-DEVELOPMENT-SNAPSHOT-2017-10-24-a swift-DEVELOPMENT-SNAPSHOT-2017-10-25-a swift-DEVELOPMENT-SNAPSHOT-2017-10-26-a swift-DEVELOPMENT-SNAPSHOT-2017-10-27-a swift-DEVELOPMENT-SNAPSHOT-2017-10-28-a swift-DEVELOPMENT-SNAPSHOT-2017-10-29-a swift-DEVELOPMENT-SNAPSHOT-2017-10-30-a swift-DEVELOPMENT-SNAPSHOT-2017-10-31-a swift-DEVELOPMENT-SNAPSHOT-2017-11-01-a swift-DEVELOPMENT-SNAPSHOT-2017-11-02-a swift-DEVELOPMENT-SNAPSHOT-2017-11-03-a swift-DEVELOPMENT-SNAPSHOT-2017-11-04-a swift-DEVELOPMENT-SNAPSHOT-2017-11-05-a swift-DEVELOPMENT-SNAPSHOT-2017-11-06-a swift-DEVELOPMENT-SNAPSHOT-2017-11-07-a swift-DEVELOPMENT-SNAPSHOT-2017-11-08-a swift-DEVELOPMENT-SNAPSHOT-2017-11-09-a swift-DEVELOPMENT-SNAPSHOT-2017-11-13-a swift-DEVELOPMENT-SNAPSHOT-2017-11-14-a swift-DEVELOPMENT-SNAPSHOT-2017-11-16-a swift-DEVELOPMENT-SNAPSHOT-2017-11-21-a swift-DEVELOPMENT-SNAPSHOT-2017-11-22-a swift-DEVELOPMENT-SNAPSHOT-2017-11-23-a swift-DEVELOPMENT-SNAPSHOT-2017-11-24-a swift-DEVELOPMENT-SNAPSHOT-2017-11-25-a swift-DEVELOPMENT-SNAPSHOT-2017-11-26-a swift-DEVELOPMENT-SNAPSHOT-2017-11-27-a swift-DEVELOPMENT-SNAPSHOT-2017-11-28-a
  2. 1c7fb28 Define XCTestCaseClosure typealias by Tiago Martinho · 7 years ago
  3. d8ad0e1 Merge pull request #203 from tiagomartinho/master by Brian Croom · 7 years ago swift-4.1-DEVELOPMENT-SNAPSHOT-2017-10-25-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-10-27-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-10-28-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-10-29-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-10-30-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-10-31-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-01-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-02-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-03-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-04-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-05-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-06-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-14-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-15-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-19-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-20-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-21-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-22-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-23-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-24-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-25-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-26-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-27-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-28-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-29-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-11-30-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-02-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-03-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-04-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-07-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-08-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-09-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-10-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-11-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-12-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-13-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-14-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-15-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-16-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-17-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-18-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-19-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-20-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-21-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-22-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-23-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-24-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-25-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-27-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-28-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-29-a swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-30-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-10-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-11-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-12-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-13-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-14-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-15-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-17-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-18-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-22-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-23-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-25-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-26-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-27-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-28-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-29-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-30-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-01-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-06-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-07-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-08-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-13-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-14-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-15-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-16-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-17-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-18-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-19-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-20-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-21-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-22-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-23-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-24-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-25-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-26-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-27-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-28-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-01-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-02-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-03-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-04-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-05-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-06-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-07-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-08-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-09-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-10-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-11-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-12-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-13-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-14-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-15-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-16-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-17-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-18-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-19-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-20-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-21-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-22-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-23-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-24-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-25-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-26-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-28-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-14-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-17-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-18-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-19-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-20-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-21-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-22-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-23-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-24-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-26-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-27-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-28-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-29-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-30-a swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-31-a swift-4.1-RELEASE swift-4.1.1-RELEASE swift-4.1.2-RELEASE swift-4.1.3-RELEASE swift-DEVELOPMENT-SNAPSHOT-2017-10-08-a swift-DEVELOPMENT-SNAPSHOT-2017-10-09-a swift-DEVELOPMENT-SNAPSHOT-2017-10-10-a swift-DEVELOPMENT-SNAPSHOT-2017-10-12-a swift-DEVELOPMENT-SNAPSHOT-2017-10-14-a swift-DEVELOPMENT-SNAPSHOT-2017-10-15-a swift-DEVELOPMENT-SNAPSHOT-2017-10-16-a swift-DEVELOPMENT-SNAPSHOT-2017-10-17-a swift-DEVELOPMENT-SNAPSHOT-2017-10-18-a swift-DEVELOPMENT-SNAPSHOT-2017-10-19-a
  4. 267a910 [SR-1047] Run xctest_checker tests in tests by Tiago Martinho · 7 years ago
  5. ad8a7f0 Merge pull request #202 from tiagomartinho/master by Brian Gesiak · 7 years ago swift-DEVELOPMENT-SNAPSHOT-2017-10-06-a swift-DEVELOPMENT-SNAPSHOT-2017-10-07-a

XCTest

The XCTest library is designed to provide a common framework for writing unit tests in Swift, for Swift packages and applications.

This version of XCTest uses the same API as the XCTest you are familiar with from Xcode. Our goal is to enable your project's tests to run on all Swift platforms without having to rewrite them.

Current Status and Project Goals

This project is in the very earliest stages of development. It is scheduled to be part of the Swift 3 release.

Only the most basic functionality is currently present. This year, we have the following goals for the project:

  • Finish implementing support for the most important non-UI testing APIs present in XCTest for Xcode.
  • Develop an effective solution to the problem of test discoverability without the Objective-C runtime.
  • Provide support for efforts to standardize test functionality across the Swift stack.

For more details, visit the Documentation directory.

Using XCTest

Your tests are organized into a simple hierarchy. Each XCTestCase subclass has a set of test methods, each of which should test one part of your code.

You can find all kinds of useful information on using XCTest in Apple's documentation.

Contributing to XCTest

To contribute, you'll need to be able to build this project and and run its test suite. The easiest way to do so is via the Swift build script.

First, follow the instructions in the Swift README to build Swift from source. Confirm you're able to build the Swift project using utils/build-script -R.

Once you are able to build the Swift project, build XCTest and run its tests:

$ cd swift-corelibs-xctest
$ ../swift/utils/build-script --preset corelibs-xctest

This project is only guaranteed to build with the very latest commit on the Swift and swift-corelibs-foundation master branches. You may update to the latest commits using the Swift utils/update-checkout script:

$ ../swift/utils/update-checkout

Using Xcode

To browse files in this project using Xcode, use XCTest.xcworkspace. You may build the project using the “SwiftXCTest” scheme. Run the “SwiftXCTestFunctionalTests” scheme to run the tests.

However, in order to successfully build the project in Xcode, you must use an Xcode toolchain with an extremely recent version of Swift. The Swift website provides Xcode toolchains to download, as well as instructions on how to use Xcode with those toolchains. Swift development moves fairly quickly, and so even a week-old toolchain may no longer work.

If none of the toolchains available to download are recent enough to build XCTest, you may build your own toolchain by using the utils/build-toolchain script in the Swift repository.

Keep in mind that the build script invocation in “Contributing to XCTest” above will always work, regardless of which Swift toolchains you have installed. The Xcode workspace exists simply for the convenience of contributors. It is not necessary to successfully build this project in Xcode in order to contribute.