[Test] Switching to testing with Swift Testing#2118
Merged
cachemeifyoucan merged 3 commits intoMay 5, 2026
Merged
Conversation
f5a2a3f to
6225a79
Compare
72339c3 to
a67a594
Compare
Contributor
Author
|
@swift-ci please test |
b03358b to
5cf5543
Compare
Contributor
Author
|
@swift-ci please test |
1 similar comment
Contributor
Author
|
@swift-ci please test |
ad92b5d to
d05d460
Compare
Contributor
Author
|
@swift-ci please test |
Add the building blocks that the Swift Testing migration depends on, without yet migrating any test files: - TestDriver: async-safe wrapper around Driver that dispatches blocking engine.build() calls off the cooperative thread pool via GCD, so tests run concurrently under Swift Testing without starving threads. - TestLocalFileSystem: FileSystem wrapper with per-instance CWD, so concurrent tests no longer mutate the process-global working directory. - DriverTestHelpers: shared test helpers (executableName, rebase, testInputsPath, toPath/toPathOption, envWithFakeSwiftHelp, ld stub, and Array<Job.ArgTemplate> extensions) that will be used after splitting SwiftDriverTests.swift. - TestExpectations: expectCommandLineContains / expectJobInvocationMatches (successor to XCTestExtensions). - testDiagnosticsHandler / verboseTestOutput: gated on SWIFT_DRIVER_TEST_VERBOSE=1 for debuggable diagnostic output.
9620b5d to
48b25fb
Compare
…DriverTests.swift Migrate all remaining XCTest-based tests in SwiftDriverTests, SwiftOptionsTests, IncrementalImportTests, and IncrementalTestFramework to Swift Testing, and break up the monolithic SwiftDriverTests.swift (9,433 lines, 221 tests) into 10 thematic test files. Assertion and suite conversions: - XCTAssert* -> #expect / #require / Issue.record - XCTestCase classes -> @suite structs with @test functions - XCTSkip -> ConditionTrait (.requireMacOS, .requireDarwin, .skipWindows, .skipDarwin, .requireFrontendArgSupport, .requireScannerSupports*, .requireExplicitModuleVerifyInterface, caching / prefix-mapping traits) - setUp/tearDown -> @suite traits or inline helpers - Driver(args:) in tests -> TestDriver(args:) (async-safe wrapper) SwiftDriverTests.swift split into: - DriverOptionTests (option parsing, module naming, settings) - CompileJobTests (compile jobs, batch mode, WMO, PCH/PCM) - LinkJobTests (linking, dsym, LTO, linker flags) - SanitizerTests (sanitizer arguments) - OptRecordTests (optimization record paths) - TargetTests (target triples, SDK versioning, platform) - ToolchainTests (toolchain paths, resource dirs, tools) - SpecialModeTests (REPL, immediate mode, help, version) - OutputJobTests (output file maps, response files, symbol graphs) - MiscDriverTests (validation, diagnostics, misc features) Helper updates: - XCTestExtensions.swift removed (superseded by TestExpectations.swift) - AssertDiagnostics.swift converted to async, uses Issue.record + SourceLocation - AssertDiagnosticsTests.swift converted using withKnownIssue - MockingIncrementalCompilation.swift and IncrementalTestHarness.swift converted to Swift Testing - IncrementalTestFramework files converted (SourceLocation-based) - TestBuildConfig gains Swift Testing ConditionTraits for feature gating - DriverExtensions.swift drops legacy test-only Driver(args:) initializer (callers use TestDriver)
48b25fb to
92393ad
Compare
Contributor
Author
|
@swift-ci please test |
Contributor
Author
|
@swift-ci please test windows platform |
nkcsgexi
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switching to Swift Testing.
The big SwiftDriverTests has been split up and the split is following:
DriverOptionTests.swift (29 tests)
CompileJobTests.swift (35 tests)
LinkJobTests.swift (15 tests)
SanitizerTests.swift (6 tests)
OptRecordTests.swift (11 tests)
TargetTests.swift (17 tests)
ToolchainTests.swift (17 tests)
SpecialModeTests.swift (15 tests)
OutputJobTests.swift (24 tests)
MiscDriverTests.swift (39 tests)
IntegrationTests.swift (kept as separate suite)