Repository navigation
Define custom availability domain for Testing symbols - #1992
Open
jerryjrchen wants to merge 2 commits into
Open
jerryjrchen wants to merge 2 commits into
jerryjrchen wants to merge 2 commits into
Conversation
jerryjrchen
requested review from
briancroom,
grynspan,
harlanhaskins and
stmontgomery
as code owners
October 28, 2026 21:59
jerryjrchen
force-pushed
the
custom-availability-domain
branch
from
October 28, 2026 23:05
bc69ea8 to
d411e60
Compare
jerryjrchen
force-pushed
the
custom-availability-domain
branch
from
October 28, 2026 23:14
d411e60 to
075ac94
Compare
stmontgomery
approved these changes
Oct 29, 2026
jerryjrchen
force-pushed
the
custom-availability-domain
branch
from
October 29, 2026 18:56
075ac94 to
bd25773
Compare
### Motivation: This domain (currently named `TestingExperimentalDevelopmentOnly`) can be applied to test library symbols to selectively include/exclude them at build time. Once the domain is enabled, `import Testing` should give you access: ```swift import Testing @available(ExperimentalDevelopmentOnly) func developmentOnly() {} ``` The domain is experimental and final name TBD. ### Modifications: Define custom availability header for Swift Testing. Resolves rdar://191149379 ### Checklist: - [ ] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [ ] If public symbols are renamed or modified, DocC references should be updated.
jerryjrchen
force-pushed
the
custom-availability-domain
branch
from
October 29, 2026 20:44
bd25773 to
898073e
Compare
| #define _SWIFT_TESTING_EXPERIMENTAL_DEVELOPMENT_AVAILABILITY_enabled 1 | ||
| #define _SWIFT_TESTING_EXPERIMENTAL_DEVELOPMENT_AVAILABILITY_disabled 2 | ||
|
|
||
| #define _SWT_MODE SWT_CONCAT(_SWIFT_TESTING_EXPERIMENTAL_DEVELOPMENT_AVAILABILITY_, _SWIFT_TESTING_EXPERIMENTAL_DEVELOPMENT_AVAILABILITY) |
Contributor
There was a problem hiding this comment.
Where is SWT_CONCAT defined?
| #if !defined(SWT_AVAILABILITY_H) | ||
| #define SWT_AVAILABILITY_H | ||
|
|
||
| #include "Defines.h" |
Contributor
There was a problem hiding this comment.
What is Defines.h being used for?
|
|
||
| #include "Defines.h" | ||
|
|
||
| #include <availability_domain.h> |
Contributor
There was a problem hiding this comment.
To avoid issues like the one causing you to need to disable this for Android, we might want to inline the pieces of availability_domain.h we're referencing so this header can be completely standalone
stmontgomery
self-requested a review
October 30, 2026 20:26
| // Any other value is an error. | ||
|
|
||
| #ifndef _SWIFT_TESTING_EXPERIMENTAL_DEVELOPMENT_AVAILABILITY | ||
| CLANG_ALWAYS_ENABLED_AVAILABILITY_DOMAIN(TestingExperimentalDevelopmentOnly); |
Contributor
There was a problem hiding this comment.
I'm used to seeing the word "Experimental" at the beginning of experimental symbol names. Should/could this be ExperimentalTestingDevelopmentOnly?
jerryjrchen
force-pushed
the
custom-availability-domain
branch
from
October 30, 2026 23:37
ea2efdb to
d3d3802
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Define custom availability domain for Testing symbols
Motivation:
This domain (currently named
TestingExperimentalDevelopmentOnly) canbe applied to test library symbols to selectively include/exclude them
at build time.
Once the domain is enabled,
import Testingshould give you access:The domain is experimental and final name TBD.
Modifications:
Define custom availability header for Swift Testing.
Resolves rdar://191149379
Checklist: