Skip to content

Commit 111518f

Browse files
committed
Update Getting Started guide to show the correct path for the XCTest repository. Also add more information on building & running tests.
1 parent 2265fda commit 111518f

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

Docs/GettingStarted.md

+33-7
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,28 @@
22

33
## On OS X
44

5-
Although OS X is not a deployment platform for Swift Foundation, it is useful for development and test purposes. The repository includes an Xcode project file as well as an Xcode workspace. The workspace includes both Foundation and XCTest, which makes it easy to build and run everything together.
5+
Although OS X is not a deployment platform for Swift Foundation, it is useful for development and test purposes.
66

77
In order to build on OS X, you will need:
88

99
* The latest version of Xcode
1010
* The latest version of the OS X SDK (at this time: 10.11)
11+
* The [current Swift toolchain](https://oss.apple.com/download/#latest-development-snapshots).
1112

12-
The Xcode workspace assumes that Foundation and XCTest are checked out from GitHub in peer directories, and with those exact names.
13+
Foundation is developed at the same time as the rest of Swift, so the most recent version of the compiler is required in order to build it.
14+
15+
The repository includes an Xcode project file as well as an Xcode workspace. The workspace includes both Foundation and XCTest, which makes it easy to build and run everything together. The workspace assumes that Foundation and XCTest are checked out from GitHub in peer directories. For example:
16+
17+
```
18+
% cd Development
19+
% ls
20+
swift-corelibs-foundation swift-corelibs-xctest
21+
%
22+
```
1323

1424
Build steps:
1525

26+
0. Run Xcode with the latest toolchain. Follow (the instructions here)[https://oss.apple.com/download/#apple-platforms] to start Xcode with the correct toolchain.
1627
0. Open `Foundation.xcworkspace`.
1728
0. Build the _Foundation_ target. This builds CoreFoundation and Foundation.
1829

@@ -27,15 +38,15 @@ You will need:
2738

2839
* A supported distribution of Linux. At this time, we support [Ubuntu 14.04 and Ubuntu 15.10](http://www.ubuntu.com).
2940

30-
To get started, follow the instructions on how to [build Swift](https://github.com/apple/swift#building-swift). Foundation requires use of the version of `swiftc` and `clang` built with the overall project.
41+
To get started, follow the instructions on how to [build Swift](https://github.com/apple/swift#building-swift). Foundation is developed at the same time as the rest of Swift, so the most recent version of the `clang` and `swift` compilers are required in order to build it.
3142

32-
The default build script does not include Foundation. To build Foundation as well, pass `--foundation` to the build script.
43+
The default build script does not include Foundation. To build Foundation and XCTest as well, pass `--xctest --foundation` to the build script.
3344

3445
```
35-
swift/utils/build-script --foundation -t
46+
swift/utils/build-script --xctest --foundation -t
3647
```
3748

38-
This will build and run the Foundation tests.
49+
This will build and run the Foundation tests, in the Debug configuration.
3950

4051
After the complete Swift build has finished, you can iterate quickly on Foundation itself by simply invoking `ninja` in the Foundation directory.
4152

@@ -50,4 +61,19 @@ This will build Foundation. To build and run the tests, use the `test` target:
5061
ninja test
5162
```
5263

53-
The script will also output some help on how to run the tests under the debugger. The exact library path to use will depend on how Foundation itself was configured.
64+
The ninja build script will print the correct command-line invocation for both running the tests and debugging the tests. The exact library path to use will depend on how Foundation itself was configured by the earlier `build-script`. For example:
65+
66+
```
67+
% ninja test
68+
[5/5] Building Tests
69+
**** RUNNING TESTS ****
70+
execute:
71+
LD_LIBRARY_PATH=../build/Ninja-ReleaseAssert/foundation-linux-x86_64/Foundation/:/home/user/Development/build/Ninja-ReleaseAssert/xctest-linux-x86_64 ../build/Ninja-ReleaseAssert/foundation-linux-x86_64/TestFoundation/TestFoundation
72+
**** DEBUGGING TESTS ****
73+
execute:
74+
LD_LIBRARY_PATH=../build/Ninja-ReleaseAssert/foundation-linux-x86_64/Foundation/:/home/user/Development/build/Ninja-ReleaseAssert/xctest-linux-x86_64 lldb ../build/Ninja-ReleaseAssert/foundation-linux-x86_64/TestFoundation/TestFoundation
75+
%
76+
```
77+
78+
Just copy & paste the correct line.
79+

0 commit comments

Comments
 (0)