You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/GettingStarted.md
+18-18
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,10 @@ Foundation is developed at the same time as the rest of Swift, so the most recen
16
16
17
17
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 sibling directories. For example:
18
18
19
-
```
20
-
% cd Development
21
-
% ls
19
+
```sh
20
+
cd Development
21
+
ls
22
22
swift-corelibs-foundation swift-corelibs-xctest
23
-
%
24
23
```
25
24
26
25
Build and test steps:
@@ -50,8 +49,9 @@ You will need:
50
49
To get started, follow the instructions on how to [build Swift](https://github.com/apple/swift/blob/main/docs/HowToGuides/GettingStarted.md#building-the-project-for-the-first-time). 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. The easiest way to make sure you have all of the correct dependencies is to build everything together.
51
50
52
51
The default build script does not include Foundation. To configure and build Foundation and TestFoundation including lldb for debugging and the correct ICU library, the following command can be used. All other tests are disabled to reduce build and test time. `--release` is used to avoid building LLVM and the compiler with debugging.
% $SWIFT_BUILD_ROOT=build $BUILD_ROOT/cmake-linux-x86_64/bin/cmake --build $BUILD_ROOT/Ninja-ReleaseAssert/foundation-linux-x86_64/ -v -- -j4 test
72
+
$SWIFT_BUILD_ROOT=build $BUILD_ROOT/cmake-linux-x86_64/bin/cmake --build $BUILD_ROOT/Ninja-ReleaseAssert/foundation-linux-x86_64/ -v -- -j4 test
74
73
```
75
74
76
75
If `TestFoundation` needs to be run outside of `ctest`, perhaps to run under `lldb` or to run individual tests, then it can be run directly but an appropriate `LD_LIBRARY_PATH`
77
76
needs to be set so that `libdispatch` and `libXCTest` can be found.
To run only one test class or a single test, the tests to run can be specified as a command argument in the form of `TestFoundation.<TestClass>{/testName}` eg to run all of the tests in `TestDate` use
85
85
`TestFoundation.TestDate`. To run just `test_BasicConstruction`, use `TestFoundation.TestDate/test_BasicConstruction`.
86
86
87
87
If the tests need to be run under `lldb`, use the following command:
When new source files or flags are added to any of the `CMakeLists.txt` files, the project will need to be reconfigured in order for the build system to pick them up. Simply rerun the `cmake` command to build `TestFoundation` given above and it should be reconfigured and built correctly.
0 commit comments