-
Notifications
You must be signed in to change notification settings - Fork 108
Add a new _TestDiscovery library/target. #981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6ae4139
Add a new _TestDiscovery library/target.
grynspan a35ffb7
Add link to GitHub issue asking for static layout validation
grynspan 95fa659
Move HMODULE enumeration to new target
grynspan 4bae45d
Try to build as a static library
grynspan 70407fc
Make HMODULE.all package-visibility since we still need it in the mai…
grynspan de87958
Simplify var context
grynspan f44b6ae
package import
grynspan 5f906ca
imageAddress type table
grynspan 04c164a
Silence warning about package import on Windows
grynspan da214be
Copy more from CMake for _TestingInternals (?)
grynspan b7ec1a8
Emit module interface
grynspan 1997bd1
Okay, we *do* need the package keyword here, the warning is just spur…
grynspan e0ef534
Silence package import warning for realsies
grynspan 0de2121
Add lib prefix to static library (needed explicitly on Windows)
grynspan f7fae0d
Add CustomStringConvertible conformance to TestContentRecord
grynspan 499bf11
Record address delta as hex
grynspan 7451e42
Update some comments/messages
grynspan 793608b
record -> recordAddress
grynspan 2ede884
Update docs
grynspan 32a51f1
Try to rationalize sendability
grynspan 7ce0121
Doc tweaks
grynspan 43437fa
Tweak imports of the new library to make them as private as possible
grynspan 7366ec7
Incorporate feedback
grynspan adff9e9
Suppress DiscoverableAsTestContent protocol from .swiftinterface files
grynspan 479149a
Remove @_spiOnly
grynspan 5dc5d10
Lower ExitTest's DiscoverableAsTestContent conformance to internal
grynspan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// This source file is part of the Swift.org open source project | ||
// | ||
// Copyright (c) 2023–2025 Apple Inc. and the Swift project authors | ||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||
// | ||
// See https://swift.org/LICENSE.txt for license information | ||
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors | ||
// | ||
|
||
@_spi(Experimental) @_spi(ForToolsIntegrationOnly) internal import _TestDiscovery | ||
|
||
/// A shadow declaration of `_TestDiscovery.DiscoverableAsTestContent` that | ||
/// allows us to add public conformances to it without causing the | ||
/// `_TestDiscovery` module to appear in `Testing.private.swiftinterface`. | ||
/// | ||
/// This protocol is not part of the public interface of the testing library. | ||
protocol DiscoverableAsTestContent: _TestDiscovery.DiscoverableAsTestContent, ~Copyable {} | ||
|
||
/// The type of the accessor function used to access a test content record. | ||
/// | ||
/// The signature of this function type must match that of the corresponding | ||
/// type in the `_TestDiscovery` module. For more information, see | ||
/// `ABI/TestContent.md`. | ||
/// | ||
/// - Warning: This type is used to implement the `@Test` macro. Do not use it | ||
/// directly. | ||
public typealias __TestContentRecordAccessor = @convention(c) ( | ||
grynspan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_ outValue: UnsafeMutableRawPointer, | ||
_ type: UnsafeRawPointer, | ||
_ hint: UnsafeRawPointer? | ||
) -> CBool | ||
|
||
/// The content of a test content record. | ||
/// | ||
/// The layout of this type must match that of the corresponding type | ||
/// in the `_TestDiscovery` module. For more information, see | ||
/// `ABI/TestContent.md`. | ||
/// | ||
/// - Warning: This type is used to implement the `@Test` macro. Do not use it | ||
/// directly. | ||
public typealias __TestContentRecord = ( | ||
kind: UInt32, | ||
reserved1: UInt32, | ||
accessor: __TestContentRecordAccessor?, | ||
context: UInt, | ||
reserved2: UInt | ||
) |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.