Skip to content

Commit d492bb1

Browse files
JoeMattcompnerd
authored andcommitted
Update GettingStarted.md
Use proper shell markdown syntax so github's copy code block function works.
1 parent 0ebc5e5 commit d492bb1

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Docs/GettingStarted.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ Foundation is developed at the same time as the rest of Swift, so the most recen
1616

1717
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:
1818

19-
```
20-
% cd Development
21-
% ls
19+
```sh
20+
cd Development
21+
ls
2222
swift-corelibs-foundation swift-corelibs-xctest
23-
%
2423
```
2524

2625
Build and test steps:
@@ -50,8 +49,9 @@ You will need:
5049
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.
5150

5251
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.
53-
```
54-
% swift/utils/build-script --libicu --lldb --release --test --foundation --xctest \
52+
53+
```sh
54+
swift/utils/build-script --libicu --lldb --release --test --foundation --xctest \
5555
--foundation-build-type=debug --skip-test-swift --skip-build-benchmarks \
5656
--skip-test-lldb --skip-test-xctest --skip-test-libdispatch --skip-test-libicu --skip-test-cmark
5757
```
@@ -65,31 +65,31 @@ After the complete Swift build has finished you can iterate over changes you mak
6565
Note that `cmake` needs to be a relatively recent version, currently 3.15.1, and if this is not installed already
6666
then it is built as part of the `build-script` invocation. Therefore `cmake` may be installed in `build/cmake`.
6767

68-
69-
```
68+
```sh
7069
# Build TestFoundation
71-
% $SWIFT_BUILD_ROOT=build $BUILD_ROOT/cmake-linux-x86_64/bin/cmake --build $BUILD_ROOT/Ninja-ReleaseAssert/foundation-linux-x86_64/ -v -- -j4 TestFoundation
70+
$SWIFT_BUILD_ROOT=build $BUILD_ROOT/cmake-linux-x86_64/bin/cmake --build $BUILD_ROOT/Ninja-ReleaseAssert/foundation-linux-x86_64/ -v -- -j4 TestFoundation
7271
# Run the tests
73-
% $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
7473
```
7574

7675
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`
7776
needs to be set so that `libdispatch` and `libXCTest` can be found.
7877

78+
```sh
79+
export BUILD_DIR=build/Ninja-ReleaseAssert
80+
export LD_LIBRARY_PATH=$BUILD_DIR/foundation-linux-x86_64/Foundation:$BUILD_DIR/xctest-linux-x86_64:$BUILD_DIR/libdispatch-linux-x86_64
81+
$BUILD_DIR/foundation-linux-x86_64/TestFoundation.app/TestFoundation
7982
```
80-
% export BUILD_DIR=build/Ninja-ReleaseAssert
81-
% export LD_LIBRARY_PATH=$BUILD_DIR/foundation-linux-x86_64/Foundation:$BUILD_DIR/xctest-linux-x86_64:$BUILD_DIR/libdispatch-linux-x86_64
82-
% $BUILD_DIR/foundation-linux-x86_64/TestFoundation.app/TestFoundation
83-
```
83+
8484
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
8585
`TestFoundation.TestDate`. To run just `test_BasicConstruction`, use `TestFoundation.TestDate/test_BasicConstruction`.
8686

8787
If the tests need to be run under `lldb`, use the following command:
8888

89-
```
90-
% export BUILD_DIR=build/Ninja-ReleaseAssert
91-
% export LD_LIBRARY_PATH=$BUILD_DIR/foundation-linux-x86_64/Foundation:$BUILD_DIR/xctest-linux-x86_64:$BUILD_DIR/libdispatch-linux-x86_64
92-
% $BUILD_DIR/lldb-linux-x86_64/bin/lldb $BUILD_DIR/foundation-linux-x86_64/TestFoundation.app/TestFoundation
89+
```sh
90+
export BUILD_DIR=build/Ninja-ReleaseAssert
91+
export LD_LIBRARY_PATH=$BUILD_DIR/foundation-linux-x86_64/Foundation:$BUILD_DIR/xctest-linux-x86_64:$BUILD_DIR/libdispatch-linux-x86_64
92+
$BUILD_DIR/lldb-linux-x86_64/bin/lldb $BUILD_DIR/foundation-linux-x86_64/TestFoundation.app/TestFoundation
9393
```
9494

9595
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

Comments
 (0)