Skip to content

Conversation

@giginet
Copy link
Owner

@giginet giginet commented Dec 27, 2025

Motivation & Context

Migrate test cases from XCTest to Swift Testing to adopt the modern testing framework.

Description

  • Migrated 5 small test files (under 200 lines) to Swift Testing:
    • ClangCheckerTests
    • BuildOptionsTests
    • XcodeVersionFetcherTests
    • InfoPlistGeneratorTests
    • DescriptionPackageTests
  • Introduced TemporaryDirectoryTrait using Swift Testing's TestScoping and TaskLocal for automatic temporary directory management
  • Reorganized test utilities into TestUtilities/ directory

giginet and others added 3 commits December 27, 2025 11:39
Migrate 5 test files under 200 lines from XCTest to Swift Testing:
- ClangCheckerTests
- BuildOptionsTests
- XcodeVersionFetcherTests
- InfoPlistGeneratorTests
- DescriptionPackageTests

Changes include:
- Replace XCTestCase classes with structs
- Replace XCTAssertEqual with #expect
- Replace XCTUnwrap with #require
- Replace setUp/tearDown with init and defer
- Add @test attributes to test methods

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduce a reusable test trait that provides temporary directory
management using Swift Testing's TestScoping and TaskLocal:

- Add TemporaryDirectoryTrait conforming to TestTrait and TestScoping
- Automatically create unique temp directory before each test
- Clean up temp directory after test completion via defer
- Expose temp directory URL through TemporaryDirectory.url TaskLocal
- Refactor InfoPlistGeneratorTests to use the new trait

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@giginet giginet force-pushed the migrate-xctest-to-swift-testing branch from cf06f77 to 9bd1058 Compare December 27, 2025 03:01
@giginet giginet merged commit be70991 into main Dec 27, 2025
3 checks passed
@giginet giginet deleted the migrate-xctest-to-swift-testing branch December 27, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant