Swift XCTest Shims that mimic Swift 3.0 APIs. For thous who wants to maintain Swift multiple versions compatibility
XCTest3 library was mainly introduced to fulfill the needs of Swift Express - web application server side framework for Swift. Now it's a part of Crossroad Labs Foundation.
Still we hope it will be useful for everybody else.
Add the following dependency to your Package.swift:
.Package(url: "https://github.com/crossroadlabs/XCTest3.git", majorVersion: 0)
swift build and build your app. Package manager is supported on OS X, but it's still recommended to be used on Linux only.
Add the following to your Cartfile:
carthage update and follow the steps as described in Carthage's README.
Add the following to your Podfile:
Make sure that you are integrating your dependencies using frameworks: add
use_frameworks! to your Podfile. Then run
OK, XCTest has changed as well since introduction of Swift 3.0. APIs are different and you either have to use
#if swift(>=3.0) excessively or use XCTest3. With XCTest3 you just use Swift 3.0 APIs. You can read more about it in Boilerplate and Foundation3.
Here is an example on how to use XCTest with Swift 3.0 APIs
let expectation = self.expectation(withDescription: "test expectation") expectation.fulfill() self.waitForExpectations(withTimeout: 0)
OK, guys. We wrap XCTest APIs as we encounter them. Want more? We are glad to accept contributions. Let's make Swift 3.0 compatibility layer together.
Keep your tests clean ;)
To get started, sign the Contributor License Agreement.