Skip to content

Commit

Permalink
[README] Explain how to run functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
modocache committed Jan 8, 2016
1 parent 589b23d commit a84cf7f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ If your install of Swift is located at `/swift` and you wish to install XCTest i
./build_script.py --swiftc="/swift/usr/bin/swiftc" --build-dir="/tmp/XCTest_build" --swift-build-dir="/swift/usr" --library-install-path="/swift/usr/lib/swift/linux" --module-install-path="/swift/usr/lib/swift/linux/x86_64"
```

To run the tests on Linux, pass the `--test` option in combination with options to
install XCTest in your active version of Swift:

```sh
./build_script.py \
--swiftc="/swift/usr/bin/swiftc" \
--build-dir="/tmp/XCTest_build" \
--swift-build-dir="/swift/usr" \
--library-install-path="/swift/usr/lib/swift/linux" \
--module-install-path="/swift/usr/lib/swift/linux/x86_64" \
--test
```

To run the tests on OS X, build and run the `SwiftXCTestFunctionalTests` target in the Xcode project.

You may add tests for XCTest by including them in the `Tests/Functional/` directory. For an example, see `Tests/Functional/SingleFailingTestCase`.

### Additional Considerations for Swift on Linux

When running on the Objective-C runtime, XCTest is able to find all of your tests by simply asking the runtime for the subclasses of `XCTestCase`. It then finds the methods that start with the string `test`. This functionality is not currently present when running on the Swift runtime. Therefore, you must currently provide an additional property called `allTests` in your `XCTestCase` subclass. This method lists all of the tests in the test class. The rest of your test case subclass still contains your test methods.
Expand Down

0 comments on commit a84cf7f

Please sign in to comment.