Skip to content

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 26 commits into from
Mar 5, 2025

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Feb 27, 2025

This PR factors out our test discovery logic into a separate module that can be imported and linked to without needing to build all of Swift Syntax and Swift Testing.

This allows test library developers to start experimenting with using the new (still experimental) test content section without needing to link to a package copy of Swift Testing.

Resolves rdar://145694068.

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 factors out our test discovery logic into a separate module that can be
imported and linked to without needing to build all of Swift Syntax and Swift
Testing.

This allows test library developers to start experimenting with using the new
(still experimental) test content section without needing to link to a package
copy of Swift Testing.
@grynspan grynspan added enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs build 🧱 Affects the project's build configuration or process labels Feb 27, 2025
@grynspan grynspan added this to the Swift 6.x milestone Feb 27, 2025
@grynspan grynspan self-assigned this Feb 27, 2025
@grynspan grynspan marked this pull request as draft February 27, 2025 17:55
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan force-pushed the jgrynspan/test-discovery-target branch from efe4a4a to b7ec1a8 Compare February 28, 2025 15:23
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Mar 1, 2025

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Mar 2, 2025

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Mar 3, 2025

@swift-ci test

@grynspan grynspan marked this pull request as ready for review March 3, 2025 19:58
@grynspan
Copy link
Contributor Author

grynspan commented Mar 3, 2025

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Mar 3, 2025

@swift-ci test

@grynspan grynspan requested a review from stmontgomery March 3, 2025 23:06
target_compile_options(_TestDiscovery PRIVATE
-enable-library-evolution
-emit-module-interface -emit-module-interface-path $<TARGET_PROPERTY:_TestDiscovery,Swift_MODULE_DIRECTORY>/_TestDiscovery.swiftinterface)
set(CMAKE_STATIC_LIBRARY_PREFIX_Swift "lib")
Copy link
Member

Choose a reason for hiding this comment

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

You should hoist this to the top level CMakeLists.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it affects anything else right now—do you feel strongly about it?

Copy link
Member

Choose a reason for hiding this comment

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

I think its best to keep this at the top level - it would be very confusing and annoying to someone not aware of it and adding another library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do it in a follow-up PR just because this one's already passed toolchain builds and I'd like to not tempt fate.

@grynspan
Copy link
Contributor Author

grynspan commented Mar 4, 2025

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Mar 4, 2025

@swift-ci test

@grynspan grynspan merged commit 4dd5548 into main Mar 5, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/test-discovery-target branch March 5, 2025 13:42
@grynspan grynspan added the discovery 🔎 test content discovery label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build 🧱 Affects the project's build configuration or process discovery 🔎 test content discovery enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants