Skip to content

[6.3.3] Add support for Swift Testing in SwiftSyntaxMacrosTestSupport#3352

Merged
stmontgomery merged 1 commit into
swiftlang:release/6.3from
stmontgomery:support-swift-testing-6.3
Jun 4, 2026
Merged

[6.3.3] Add support for Swift Testing in SwiftSyntaxMacrosTestSupport#3352
stmontgomery merged 1 commit into
swiftlang:release/6.3from
stmontgomery:support-swift-testing-6.3

Conversation

@stmontgomery

@stmontgomery stmontgomery commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
  • Explanation: This adds support for using the assertMacroExpansion API to test macro implementation logic from Swift Testing tests. Until now, it has only been supported from within XCTests, and attempting to use it from Swift Testing could give a false positive since it never reported failures.
  • Scope: Affects SwiftSyntaxMacrosTestSupport, the module used to unit test macro implementations. There should be no change to the behavior of existing tests unless they're passing when they shouldn't be (such as if they're using this API from Swift Testing despite it being unsupported and there are legitimate failures).
  • Issues: Adopt Swift-Testing in test utils such as SwiftSyntaxMacrosTestSupport #2720
  • Original PRs: Add support for Swift Testing in SwiftSyntaxMacrosTestsSupport #3192
  • Risk: Low, and only affects test code. If clients use swift-syntax and also have a package dependency on Swift Testing, they could encounter nondeterministic build problems. However, that practice is uncommon and formally discouraged in favor of the toolchain copy.
  • Testing: Includes new unit tests, and I performed manual testing against a sample package with macro tests.
  • Reviewers: @rintaro, @0xTim

@stmontgomery stmontgomery self-assigned this Jun 4, 2026
@stmontgomery stmontgomery added the Macros Issues in the SwiftSyntaxMacro… modules label Jun 4, 2026
@stmontgomery

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@stmontgomery stmontgomery changed the title [6.3.3] Add support for Swift Testing in SwiftSyntaxMacrosTestsSupport [6.3.3] Add support for Swift Testing in SwiftSyntaxMacrosTestSupport Jun 4, 2026
@stmontgomery stmontgomery merged commit 210c77f into swiftlang:release/6.3 Jun 4, 2026
67 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Macros Issues in the SwiftSyntaxMacro… modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants