Skip to content

Commit 6ac8075

Browse files
committed
[docs] Recommend using utils/build-script to test
Contributors likely won't need to invoke CMake directly in order to run the test suite. As such, the current testing documentation is a little misleading: it jumps into a detailed explanation of the `check-swift` family of targets, even though those are abstracted away via the build script. For example, I remember when I first read this document, I spent 20 minutes searching in vain for a build executable named `check-swift`. Instead, change the wording to make it clear that `utils/build-script` is the best way to run the tests. For those interested in **how** the tests are executed, show an example of a CMake command that runs them.
1 parent 80eb599 commit 6ac8075

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

docs/Testing.rst

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,24 @@ The LLVM lit-based testsuite
3636
Running the LLVM lit-based testsuite
3737
------------------------------------
3838

39-
You can run Swift tests using the ``build-script``, or, alternatively, using
40-
these targets in the build directory:
39+
It is recommended that you run the Swift test suites via ``utils/build-script``.
40+
For day-to-day work on the Swift compiler, using ``utils/build-script --test``
41+
should be sufficient. The buildbot runs validation tests, so if those are
42+
accidentally broken, it should not go unnoticed.
43+
44+
Before committing a large change to a compiler (especially a language change),
45+
or API changes to the standard library, it is recommended to run validation
46+
test suite, via ``utils/build-script --validation-test``.
47+
48+
Although it is not recommended for day-to-day contributions, it is also
49+
technically possible to execute the tests directly via CMake. For example, if you have
50+
built Swift products at the directory ``build/Ninja-ReleaseAssert/swift-macosx-x86_64``,
51+
you may run the entire test suite directly using the following command::
52+
53+
cmake --build build/Ninja-ReleaseAssert/swift-macosx-x86_64 -- check-swift-macosx-x86_64
54+
55+
Note that ``check-swift`` is suffixed with a target operating system and architecture.
56+
Besides ``check-swift``, other targets are also available. Here's the full list:
4157

4258
* ``check-swift``
4359

@@ -51,14 +67,6 @@ these targets in the build directory:
5167

5268
Runs all tests.
5369

54-
For day-to-day work on the Swift compiler, using ``check-swift`` should be
55-
sufficient. The buildbot runs validation tests, so if those are accidentally
56-
broken, it should not go unnoticed.
57-
58-
Before committing a large change to a compiler (especially a language change),
59-
or API changes to the standard library, it is recommended to run validation
60-
test suite.
61-
6270
For every target above, there are variants for different optimizations:
6371

6472
* the target itself (e.g., ``check-swift``) -- runs all tests from the primary

0 commit comments

Comments
 (0)