Skip to content
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

Add a Bundle.testTarget property. #848

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Dec 10, 2024

This PR adds an experimental class property to Bundle in the Foundation cross-import overlay. The property's value represents the bundle containing the test target. On Apple platforms, this is an XCTest bundle. Elsewhere, it's just the main bundle.

This is an experimental interface only.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

This PR adds an experimental class property to `Bundle` in the Foundation cross-import
overlay. The property's value represents the bundle containing the test target. On Apple
platforms, this is an XCTest bundle. Elsewhere, it's just the main bundle.

This is an experimental interface only.
@grynspan grynspan added enhancement New feature or request public-api Affects public API labels Dec 10, 2024
@grynspan grynspan self-assigned this Dec 10, 2024
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test Windows

@grynspan grynspan added this to the Swift 6.x milestone Dec 10, 2024
///
/// - Note: This property accesses the file system the first time it is used.
@_spi(Experimental)
public static var testTarget: Bundle {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we should extend Foundation this way from Testing. The correct way would be implementation in Foundation itself, following the process there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a prototype only. 🙂 We can certainly follow the Foundation review process for this feature (in whatever form it takes) although due to layering it may need to live here in the overlay.

I have no plans to merge this without your team's signoff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request public-api Affects public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants