swift-syntax icon indicating copy to clipboard operation
swift-syntax copied to clipboard

Add support for Swift Testing in SwiftSyntaxMacrosTestsSupport

Open 0xTim opened this issue 3 months ago • 0 comments

  • Explanation: As described in https://github.com/swiftlang/swift-syntax/issues/2720 SwiftSyntaxMacrosTestsSupport does not work with Swift Testing, which is an issue given Swift Testing is the way to test projects and XCTest is deprecated. If produces false positives (where tests pass even if they shouldn't) which is a major issue, especially as there are no warnings.

This PR adds support for Swift Testing so that tests fail correctly. This does not introduce an issue with a circular dependency on Swift Testing. There is a circular dependency at the package level, but this is allowed due to https://github.com/swiftlang/swift-package-manager/pull/7530. There is no circular dependency between targets.

  • Scope: No changes to existing code unless tests are passing when they shouldn't be. Only affects SwiftSyntaxMacrosTestsSupport
  • Issues: https://github.com/swiftlang/swift-syntax/issues/2720
  • Risk: Low risk
  • Testing: Tests written to ensure it fails as expected
  • Reviewers:

0xTim avatar Nov 21 '25 17:11 0xTim