commit | db60942ca934b6381dc0a81b766e719c98ee5af3 | [log] [tgz] |
---|---|---|
author | Brian Gesiak <bgesiak@fb.com> | Mon Mar 21 01:49:14 2016 -0400 |
committer | Brian Gesiak <modocache@gmail.com> | Fri Apr 08 16:18:20 2016 -0400 |
tree | 4d17eeb6ab042da6554902460c295eb840aab5c2 | |
parent | db3643a469bea4faab3e2d23170cddb25c364662 [diff] |
[README] Encourage using the Swift build script New contributors to swift-corelibs-xctest are having some difficulty knowing where to start: - https://bugs.swift.org/browse/SR-981 - https://bugs.swift.org/browse/SR-907 - https://bugs.swift.org/browse/SR-906 The problem is that over time this project has begun to take on more dependencies: - To build the project, one must use a modern Swift 3 compiler (often one more recent than the latest https://swift.org snapshot). - To build the project, one must have swift-corelibs-foundation checked out at a particular path. - To run the test suite, one must have the LLVM `lit` test runner installed at a particular path. In addition, the build steps differ based on whether the contributor is using an OS X or Linux development environment. This commit revamps the README and the Linux `build_script.py` to require fewer steps for new contributors to get started. Specifically, it encourages contributors to use the Swift `utils/build-script`. There are many reasons to do so: - The XCTest CI uses that script, so contributors will need to make sure it passes to get their contributions merged. - That script ensures that the correct build of `swiftc` and swift-corelibs-foundation are used. - That script works across all platforms, and is invoked in the same way on each platform. In addition, more detailed information on the project has been moved to a Documentation directory. This resembles other projects in the Swift family of repositories.
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.
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:
For more details, visit the Documentation
directory.
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.
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
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 contibutors. It is not necessary to successfully build this project in Xcode in order to contribute.