Skip to content

Commit 2f62bf4

Browse files
committed
[docs] Add a couple of paragraphs about swift_feature in testing.md
Quickly explain the feature, its intended usage and a warning about not longer needing `REQUIRES: asserts` anymore.`
1 parent 2cad3ca commit 2f62bf4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/Testing.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,27 @@ FIXME: full list.
549549
* ``XFAIL: linux``: tests that need to be adapted for Linux, for example parts
550550
that depend on Objective-C interop need to be split out.
551551

552+
#### Features ``REQUIRES: swift_feature_...``
553+
554+
Each of the Swift compiler features defined in `include/swift/Basic/Features.def`
555+
will get a LLVM Lit feature prefixing `swift_feature_` to the feature name
556+
automatically. The LLVM Lit features will be available only in those
557+
configurations where the compiler supports the given feature, and will not be
558+
available when the compiler does not support the feature. This means that
559+
standard language features and upcoming features will always be available,
560+
while experimental features will only be available when the compiler supports
561+
them.
562+
563+
For every test that uses `--enable-experimental-feature` or
564+
`--enable-upcoming-feature` add a `REQUIRES: swift_feature_...` for each of the
565+
used features. The `Misc/verify-swift-feature-testing.test-sh` will check that
566+
every test with those command line arguments have the necessary `REQUIRES:` and
567+
fail otherwise.
568+
569+
Do NOT add `REQUIRES: asserts` for experimental features anymore. The correct
570+
usage of `REQUIRES: swift_feature_...` will take care of testing the feature as
571+
it evolves from experimental, to upcoming, to language feature.
572+
552573
#### Feature ``REQUIRES: executable_test``
553574

554575
This feature marks an executable test. The test harness makes this feature

0 commit comments

Comments
 (0)