@@ -179,7 +179,7 @@ package enum TestOutput: String, ExpressibleByArgument {
179179}
180180
181181/// swift-test tool namespace
182- package struct SwiftTestCommand : SwiftCommand {
182+ package struct SwiftTestCommand : AsyncSwiftCommand {
183183 package static var configuration = CommandConfiguration (
184184 commandName: " test " ,
185185 _superCommandName: " swift " ,
@@ -200,7 +200,7 @@ package struct SwiftTestCommand: SwiftCommand {
200200
201201 // MARK: - XCTest
202202
203- private func xctestRun( _ swiftCommandState: SwiftCommandState ) throws {
203+ private func xctestRun( _ swiftCommandState: SwiftCommandState ) async throws {
204204 // validate XCTest available on darwin based systems
205205 let toolchain = try swiftCommandState. getTargetToolchain ( )
206206 let isHostTestingAvailable = try swiftCommandState. getHostToolchain ( ) . swiftSDK. supportsTesting
@@ -218,7 +218,7 @@ package struct SwiftTestCommand: SwiftCommand {
218218 let testProducts = try buildTestsIfNeeded ( swiftCommandState: swiftCommandState, library: . xctest)
219219 if !self . options. shouldRunInParallel {
220220 let xctestArgs = try xctestArgs ( for: testProducts, swiftCommandState: swiftCommandState)
221- try runTestProducts (
221+ try await runTestProducts (
222222 testProducts,
223223 additionalArguments: xctestArgs,
224224 buildParameters: buildParameters,
@@ -269,7 +269,7 @@ package struct SwiftTestCommand: SwiftCommand {
269269
270270 // process code Coverage if request
271271 if self . options. enableCodeCoverage, runner. ranSuccessfully {
272- try processCodeCoverage ( testProducts, swiftCommandState: swiftCommandState, library: . xctest)
272+ try await processCodeCoverage ( testProducts, swiftCommandState: swiftCommandState, library: . xctest)
273273 }
274274
275275 if !runner. ranSuccessfully {
@@ -337,11 +337,11 @@ package struct SwiftTestCommand: SwiftCommand {
337337
338338 // MARK: - swift-testing
339339
340- private func swiftTestingRun( _ swiftCommandState: SwiftCommandState ) throws {
340+ private func swiftTestingRun( _ swiftCommandState: SwiftCommandState ) async throws {
341341 let buildParameters = try swiftCommandState. buildParametersForTest ( options: self . options, library: . swiftTesting)
342342 let testProducts = try buildTestsIfNeeded ( swiftCommandState: swiftCommandState, library: . swiftTesting)
343343 let additionalArguments = Array ( CommandLine . arguments. dropFirst ( ) )
344- try runTestProducts (
344+ try await runTestProducts (
345345 testProducts,
346346 additionalArguments: additionalArguments,
347347 buildParameters: buildParameters,
@@ -352,7 +352,7 @@ package struct SwiftTestCommand: SwiftCommand {
352352
353353 // MARK: - Common implementation
354354
355- package func run( _ swiftCommandState: SwiftCommandState ) throws {
355+ package func run( _ swiftCommandState: SwiftCommandState ) async throws {
356356 do {
357357 // Validate commands arguments
358358 try self . validateArguments ( observabilityScope: swiftCommandState. observabilityScope)
@@ -369,10 +369,10 @@ package struct SwiftTestCommand: SwiftCommand {
369369 try command. run ( swiftCommandState)
370370 } else {
371371 if try options. testLibraryOptions. enableSwiftTestingLibrarySupport ( swiftCommandState: swiftCommandState) {
372- try swiftTestingRun ( swiftCommandState)
372+ try await swiftTestingRun ( swiftCommandState)
373373 }
374374 if options. testLibraryOptions. enableXCTestSupport {
375- try xctestRun ( swiftCommandState)
375+ try await xctestRun ( swiftCommandState)
376376 }
377377 }
378378 }
@@ -383,7 +383,7 @@ package struct SwiftTestCommand: SwiftCommand {
383383 buildParameters: BuildParameters ,
384384 swiftCommandState: SwiftCommandState ,
385385 library: BuildParameters . Testing . Library
386- ) throws {
386+ ) async throws {
387387 // Clean out the code coverage directory that may contain stale
388388 // profraw files from a previous run of the code coverage tool.
389389 if self . options. enableCodeCoverage {
@@ -418,7 +418,7 @@ package struct SwiftTestCommand: SwiftCommand {
418418 }
419419
420420 if self . options. enableCodeCoverage, ranSuccessfully {
421- try processCodeCoverage ( testProducts, swiftCommandState: swiftCommandState, library: library)
421+ try await processCodeCoverage ( testProducts, swiftCommandState: swiftCommandState, library: library)
422422 }
423423
424424 if self . options. enableExperimentalTestOutput, !ranSuccessfully {
@@ -462,16 +462,13 @@ package struct SwiftTestCommand: SwiftCommand {
462462 _ testProducts: [ BuiltTestProduct ] ,
463463 swiftCommandState: SwiftCommandState ,
464464 library: BuildParameters . Testing . Library
465- ) throws {
465+ ) async throws {
466466 let workspace = try swiftCommandState. getActiveWorkspace ( )
467467 let root = try swiftCommandState. getWorkspaceRoot ( )
468- let rootManifests = try temp_await {
469- workspace. loadRootManifests (
470- packages: root. packages,
471- observabilityScope: swiftCommandState. observabilityScope,
472- completion: $0
473- )
474- }
468+ let rootManifests = try await workspace. loadRootManifests (
469+ packages: root. packages,
470+ observabilityScope: swiftCommandState. observabilityScope
471+ )
475472 guard let rootManifest = rootManifests. values. first else {
476473 throw StringError ( " invalid manifests at \( root. packages) " )
477474 }
0 commit comments