Make all test content types directly conform to TestContent.#920
Merged
Conversation
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test Windows |
grynspan
commented
Jan 20, 2025
| /// - Returns: An array of structures describing the bounds of all known test | ||
| /// content sections in the current process. | ||
| private func _sectionBounds(_ kind: SectionBounds.Kind) -> [SectionBounds] { | ||
| private func _sectionBounds(_ kind: SectionBounds.Kind) -> some Sequence<SectionBounds> { |
Contributor
Author
There was a problem hiding this comment.
Drive-by fix, this should be a lazy sequence rather than an array.
Contributor
Author
|
@swift-ci test |
1 similar comment
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test Linux |
Contributor
Author
|
@swift-ci test macOS |
Contributor
Author
|
@swift-ci test Windows |
Contributor
Author
|
@swift-ci test |
1 similar comment
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test Linux |
stmontgomery
approved these changes
Jan 21, 2025
This PR eliminates the `TestContentAccessorResult` associated type from the (currently internal, potentially eventually API) `TestContent` protocol. This associated type needed to be `~Copyable` so `ExitTest` could be used with it, but that appears to pose some _problems_ for the compiler (rdar://143049814&143080508). Instead, we remove the associated type and just say "the test content record is the type that conforms to `TestContent`". `ExitTest` is happy with this, but `Test`'s produced type is a non-nominal function type, so we wrap that function in a small private type with identical layout and have that type conform. The ultimate purpose of this PR is to get us a bit closer to turning `TestContent` into a public or tools-SPI protocol that other components can use for test discovery.
…mentation to tell devs not to use our typealias because it'll almost certainly break them in the future
… not a collection, and may not be enumerable twice--cast to array for the bulk of the test
c35cde4 to
266405c
Compare
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test Windows |
Contributor
Author
|
@swift-ci test macOS |
briancroom
approved these changes
Jan 21, 2025
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.
This PR eliminates the
TestContentAccessorResultassociated type from the (currently internal, potentially eventually API)TestContentprotocol. This associated type needed to be~CopyablesoExitTestcould be used with it, but that appears to pose some problems for the compiler (rdar://143049814&143080508).Instead, we remove the associated type and just say "the test content record is the type that conforms to
TestContent".ExitTestis happy with this, butTest's produced type is a non-nominal function type, so we wrap that function in a small private type with identical layout and have that type conform.The ultimate purpose of this PR is to get us a bit closer to turning
TestContentinto a public or tools-SPI protocol that other components can use for test discovery.Checklist: