-
Notifications
You must be signed in to change notification settings - Fork 115
Make all test content types directly conform to TestContent
.
#920
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
Conversation
@swift-ci test |
@swift-ci test Windows |
@@ -230,7 +230,7 @@ private func _findSection(named sectionName: String, in hModule: HMODULE) -> Sec | |||
/// | |||
/// - 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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by fix, this should be a lazy sequence rather than an array.
@swift-ci test |
1 similar comment
@swift-ci test |
@swift-ci test Linux |
@swift-ci test macOS |
@swift-ci test Windows |
@swift-ci test |
1 similar comment
@swift-ci test |
@swift-ci test Linux |
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
@swift-ci test |
@swift-ci test Windows |
@swift-ci test macOS |
This PR eliminates the
TestContentAccessorResult
associated type from the (currently internal, potentially eventually API)TestContent
protocol. This associated type needed to be~Copyable
soExitTest
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, 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
TestContent
into a public or tools-SPI protocol that other components can use for test discovery.Checklist: