Skip to content

Conversation

@jerryjrchen
Copy link
Contributor

@jerryjrchen jerryjrchen commented Oct 16, 2025

Minimal version of the changes in Jonathan's original PR here: #1280

The new library is renamed to be "_TestingInterop" to more closely match its intended (and limited) purpose, but that's open to further discussion.

Motivation:

This library will eventually be visible in the toolchain, and either testing library (Swift Testing or XCTest) will be able to use it to pass along unhandled issues to a test runner from the other framework, enabling interoperability.

Modifications:

Fallback handler is currently unchanged from #1280. The docs have been updated to describe intended usage.

No tests are included in this change because the interop library must make it into the toolchain first before we can write tests against it. Tests will be coming in the near future!

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.
  • Toolchain build succeeds
  • Expected symbols are visible in the toolchain build*

Ubuntu:

~/Downloads/usr ❯ nm lib/swift/linux/lib_TestingInterop.so | rg handler
• <stdin>
1:0000000000002140 b $s15_TestingInterop21_fallbackEventHandler33_AF82E98923290C49994CD1CA5A7BD647LL15Synchronization6AtomicVySVSgGvp
2:0000000000000b50 T $s15_TestingInterop38_swift_testing_getFallbackEventHandlerySPys4Int8VG_SVSiSVSgtYbXCSgyF
3:0000000000000b70 T $s15_TestingInterop42_swift_testing_installFallbackEventHandlerySbySPys4Int8VG_SVSiSVSgtYbXCF
57:0000000000000b40 T _swift_testing_getFallbackEventHandler
58:0000000000000b60 T _swift_testing_installFallbackEventHandler

macOS:

~/Downloads/Library ❯ nm Developer/Toolchains/swift-PR-84971-2110.xctoolchain/usr/lib/swift/macosx/testing/lib_TestingInterop.dylib | rg handler
• <stdin>
1:0000000000003bbc t _$s15_TestingInterop21_fallbackEventHandler33_AF82E98923290C49994CD1CA5A7BD647LL_WZ
2:0000000000008010 b _$s15_TestingInterop21_fallbackEventHandler33_AF82E98923290C49994CD1CA5A7BD647LL_Wz
3:0000000000008018 b _$s15_TestingInterop21_fallbackEventHandler33_AF82E98923290C49994CD1CA5A7BD647LLs13ManagedBufferCyySPys4Int8VG_SVSiSVSgtYbXCSgSo16os_unfair_lock_sVGvp
4:0000000000003c50 T _$s15_TestingInterop38_swift_testing_getFallbackEventHandlerySPys4Int8VG_SVSiSVSgtYbXCSgyF
5:0000000000003d24 T _$s15_TestingInterop42_swift_testing_installFallbackEventHandlerySbySPys4Int8VG_SVSiSVSgtYbXCF
46:0000000000003bf0 T __swift_testing_getFallbackEventHandler
47:0000000000003cb0 T __swift_testing_installFallbackEventHandler

Windows does not have the interop lib yet since it requires changes to https://github.com/swiftlang/swift-installer-scripts. This will be done in a follow-up :)

@jerryjrchen jerryjrchen added this to the Swift 6.x (main) milestone Oct 16, 2025
@jerryjrchen jerryjrchen self-assigned this Oct 16, 2025
@jerryjrchen jerryjrchen added enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs issue-handling Related to Issue handling within the testing library labels Oct 16, 2025
@jerryjrchen jerryjrchen changed the title Create fallback event handler library Create fallback event handler library for Swift Testing and XCTest interop Oct 16, 2025
Minimal version of the changes in Jonathan's original PR here:
swiftlang#1280

The new library is renamed to be "_TestingInterop" to more closely match
its intended (and limited) purpose, but that's open to further
discussion.

This library will eventually be visible in the toolchain, and either
testing library (Swift Testing or XCTest) will be able to use it to pass
along unhandled issues to a test runner from the other framework,
enabling interoperability.
@jerryjrchen jerryjrchen force-pushed the create-interop-library branch from fda7e93 to ee0f2ea Compare October 21, 2025 21:14
@jerryjrchen jerryjrchen marked this pull request as ready for review October 21, 2025 21:15
Copy link
Contributor

@grynspan grynspan left a comment

Choose a reason for hiding this comment

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

Please hold off merging until the toolchain builds have finished and you've confirmed the binaries are emitted with the right exported symbols. Thanks!

@jerryjrchen jerryjrchen force-pushed the create-interop-library branch from ee0f2ea to cff44ba Compare October 22, 2025 00:42
@jerryjrchen jerryjrchen merged commit 6a4a3a9 into swiftlang:main Oct 23, 2025
47 of 48 checks passed
@jerryjrchen jerryjrchen deleted the create-interop-library branch October 23, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request issue-handling Related to Issue handling within the testing library tools integration 🛠️ Integration of swift-testing into tools/IDEs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants