@@ -2802,8 +2802,16 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
2802
2802
// Only run the test if the environment in which we're running actually supports Swift concurrency (which the plugin APIs require).
2803
2803
try XCTSkipIf ( !UserToolchain. default. supportsSwiftConcurrency ( ) , " skipping because test environment doesn't support concurrency " )
2804
2804
2805
- let debugTarget = [ " .build " , " debug " , executableName ( " placeholder " ) ]
2806
- let releaseTarget = [ " .build " , " release " , executableName ( " placeholder " ) ]
2805
+ #if os(Linux)
2806
+ let osSuffix = " -linux "
2807
+ #elseif os(Windows)
2808
+ let osSuffix = " -windows "
2809
+ #else
2810
+ let osSuffix = " "
2811
+ #endif
2812
+
2813
+ let debugTarget = self . buildSystemProvider == . native ? [ " .build " , " debug " , executableName ( " placeholder " ) ] : [ " .build " , try UserToolchain . default. targetTriple. platformBuildPathComponent, " Products " , " Debug \( osSuffix) " , " placeholder " ]
2814
+ let releaseTarget = self . buildSystemProvider == . native ? [ " .build " , " release " , executableName ( " placeholder " ) ] : [ " .build " , try UserToolchain . default. targetTriple. platformBuildPathComponent, " Products " , " Release \( osSuffix) " , " placeholder " ]
2807
2815
2808
2816
func AssertIsExecutableFile( _ fixturePath: AbsolutePath , file: StaticString = #filePath, line: UInt = #line) {
2809
2817
XCTAssert (
@@ -2837,6 +2845,10 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
2837
2845
AssertNotExists ( fixturePath. appending ( components: releaseTarget) )
2838
2846
}
2839
2847
2848
+ if self . buildSystemProvider == . swiftbuild && ProcessInfo . hostOperatingSystem != . macOS {
2849
+ throw XCTSkip ( " Failed to find dsymutil tool: https://github.com/swiftlang/swift-package-manager/issues/8862 " )
2850
+ }
2851
+
2840
2852
// If the plugin requests a release binary, that is what will be built, regardless of overall configuration
2841
2853
try await fixture ( name: " Miscellaneous/Plugins/CommandPluginTestStub " ) { fixturePath in
2842
2854
let _ = try await self . execute ( [ " -c " , " debug " , " build-target " , " build-release " ] , packagePath: fixturePath)
@@ -2868,6 +2880,8 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
2868
2880
await XCTAssertAsyncNoThrow ( try await self . execute ( [ " -c " , " debug " , " check-testability " , " InternalModule " , " debug " , " true " ] , packagePath: fixturePath) )
2869
2881
}
2870
2882
2883
+ if buildSystemProvider == . swiftbuild && ProcessInfo . hostOperatingSystem != . macOS { throw XCTSkip ( " Failed to find dsymutil tool: https://github.com/swiftlang/swift-package-manager/issues/8862 " ) }
2884
+
2871
2885
// Overall configuration: debug, plugin build request: release -> without testability
2872
2886
try await fixture ( name: " Miscellaneous/Plugins/CommandPluginTestStub " ) { fixturePath in
2873
2887
await XCTAssertAsyncNoThrow ( try await self . execute ( [ " -c " , " debug " , " check-testability " , " InternalModule " , " release " , " false " ] , packagePath: fixturePath) )
@@ -2914,7 +2928,8 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
2914
2928
XCTAssertMatch ( stdout, isEmpty)
2915
2929
// Filter some unrelated output that could show up on stderr.
2916
2930
let filteredStderr = stderr. components ( separatedBy: " \n " )
2917
- . filter { !$0. contains ( " Unable to locate libSwiftScan " ) } . joined ( separator: " \n " )
2931
+ . filter { !$0. contains ( " Unable to locate libSwiftScan " ) }
2932
+ . filter { !( $0. contains ( " warning: " ) && $0. contains ( " unable to find libclang " ) ) } . joined ( separator: " \n " )
2918
2933
XCTAssertMatch ( filteredStderr, isEmpty)
2919
2934
}
2920
2935
@@ -2924,7 +2939,8 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
2924
2939
XCTAssertMatch ( stdout, containsLogtext)
2925
2940
// Filter some unrelated output that could show up on stderr.
2926
2941
let filteredStderr = stderr. components ( separatedBy: " \n " )
2927
- . filter { !$0. contains ( " Unable to locate libSwiftScan " ) } . joined ( separator: " \n " )
2942
+ . filter { !$0. contains ( " Unable to locate libSwiftScan " ) }
2943
+ . filter { !( $0. contains ( " warning: " ) && $0. contains ( " unable to find libclang " ) ) } . joined ( separator: " \n " )
2928
2944
XCTAssertMatch ( filteredStderr, isEmpty)
2929
2945
}
2930
2946
@@ -3462,9 +3478,11 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
3462
3478
let ( stdout, _) = try await self . execute ( [ " my-build-tester " , " --product " , " MyExecutable " , " --print-commands " ] , packagePath: packageDir)
3463
3479
XCTAssertMatch ( stdout, . contains( " Building for debugging... " ) )
3464
3480
XCTAssertNoMatch ( stdout, . contains( " Building for production... " ) )
3465
- XCTAssertMatch ( stdout, . contains( " -module-name MyExecutable " ) )
3466
- XCTAssertMatch ( stdout, . contains( " -DEXTRA_SWIFT_FLAG " ) )
3467
- XCTAssertMatch ( stdout, . contains( " Build of product 'MyExecutable' complete! " ) )
3481
+ if buildSystemProvider == . native {
3482
+ XCTAssertMatch ( stdout, . contains( " -module-name MyExecutable " ) )
3483
+ XCTAssertMatch ( stdout, . contains( " -DEXTRA_SWIFT_FLAG " ) )
3484
+ XCTAssertMatch ( stdout, . contains( " Build of product 'MyExecutable' complete! " ) )
3485
+ }
3468
3486
XCTAssertMatch ( stdout, . contains( " succeeded: true " ) )
3469
3487
switch buildSystemProvider {
3470
3488
case . native:
@@ -3483,7 +3501,9 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
3483
3501
XCTAssertMatch ( stdout, . contains( " Building for production... " ) )
3484
3502
XCTAssertNoMatch ( stdout, . contains( " Building for debug... " ) )
3485
3503
XCTAssertNoMatch ( stdout, . contains( " -module-name MyExecutable " ) )
3486
- XCTAssertMatch ( stdout, . contains( " Build of product 'MyExecutable' complete! " ) )
3504
+ if buildSystemProvider == . native {
3505
+ XCTAssertMatch ( stdout, . contains( " Build of product 'MyExecutable' complete! " ) )
3506
+ }
3487
3507
XCTAssertMatch ( stdout, . contains( " succeeded: true " ) )
3488
3508
switch buildSystemProvider {
3489
3509
case . native:
@@ -3494,6 +3514,11 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
3494
3514
XCTFail ( " unimplemented assertion for --build-system xcode " )
3495
3515
}
3496
3516
XCTAssertMatch ( stdout, . and( . contains( " artifact-kind: " ) , . contains( " executable " ) ) )
3517
+ } catch {
3518
+ if ProcessInfo . hostOperatingSystem != . macOS && self . buildSystemProvider == . swiftbuild {
3519
+ throw XCTSkip ( " Failed to find dsymutil tool: https://github.com/swiftlang/swift-package-manager/issues/8862 " )
3520
+ }
3521
+ throw error
3497
3522
}
3498
3523
3499
3524
// Invoke the plugin with parameters choosing a verbose build of MyStaticLibrary for release.
@@ -3502,7 +3527,9 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
3502
3527
XCTAssertMatch ( stdout, . contains( " Building for production... " ) )
3503
3528
XCTAssertNoMatch ( stdout, . contains( " Building for debug... " ) )
3504
3529
XCTAssertNoMatch ( stdout, . contains( " -module-name MyLibrary " ) )
3505
- XCTAssertMatch ( stdout, . contains( " Build of product 'MyStaticLibrary' complete! " ) )
3530
+ if buildSystemProvider == . native {
3531
+ XCTAssertMatch ( stdout, . contains( " Build of product 'MyStaticLibrary' complete! " ) )
3532
+ }
3506
3533
XCTAssertMatch ( stdout, . contains( " succeeded: true " ) )
3507
3534
switch buildSystemProvider {
3508
3535
case . native:
@@ -3513,6 +3540,11 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
3513
3540
XCTFail ( " unimplemented assertion for --build-system xcode " )
3514
3541
}
3515
3542
XCTAssertMatch ( stdout, . and( . contains( " artifact-kind: " ) , . contains( " staticLibrary " ) ) )
3543
+ } catch {
3544
+ if ProcessInfo . hostOperatingSystem != . macOS && self . buildSystemProvider == . swiftbuild {
3545
+ throw XCTSkip ( " Failed to find dsymutil tool: https://github.com/swiftlang/swift-package-manager/issues/8862 " )
3546
+ }
3547
+ throw error
3516
3548
}
3517
3549
3518
3550
// Invoke the plugin with parameters choosing a verbose build of MyDynamicLibrary for release.
@@ -3521,7 +3553,9 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
3521
3553
XCTAssertMatch ( stdout, . contains( " Building for production... " ) )
3522
3554
XCTAssertNoMatch ( stdout, . contains( " Building for debug... " ) )
3523
3555
XCTAssertNoMatch ( stdout, . contains( " -module-name MyLibrary " ) )
3524
- XCTAssertMatch ( stdout, . contains( " Build of product 'MyDynamicLibrary' complete! " ) )
3556
+ if buildSystemProvider == . native {
3557
+ XCTAssertMatch ( stdout, . contains( " Build of product 'MyDynamicLibrary' complete! " ) )
3558
+ }
3525
3559
XCTAssertMatch ( stdout, . contains( " succeeded: true " ) )
3526
3560
switch buildSystemProvider {
3527
3561
case . native:
@@ -3536,6 +3570,11 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
3536
3570
XCTFail ( " unimplemented assertion for --build-system xcode " )
3537
3571
}
3538
3572
XCTAssertMatch ( stdout, . and( . contains( " artifact-kind: " ) , . contains( " dynamicLibrary " ) ) )
3573
+ } catch {
3574
+ if ProcessInfo . hostOperatingSystem != . macOS && self . buildSystemProvider == . swiftbuild {
3575
+ throw XCTSkip ( " Failed to find dsymutil tool: https://github.com/swiftlang/swift-package-manager/issues/8862 " )
3576
+ }
3577
+ throw error
3539
3578
}
3540
3579
}
3541
3580
}
@@ -4097,9 +4136,14 @@ class PackageCommandSwiftBuildTests: PackageCommandTestCase {
4097
4136
override func testNoParameters( ) async throws {
4098
4137
try await super. testNoParameters ( )
4099
4138
}
4100
-
4101
- override func testCommandPluginBuildTestability( ) async throws {
4102
- throw XCTSkip ( " SWBINTTODO: Test fails as plugins are not currenty supported " )
4139
+
4140
+ override func testCommandPluginSymbolGraphCallbacks( ) async throws {
4141
+ throw XCTSkip ( " SWBINTTODO: Symbol graph extraction does not yet work with swiftbuild build system " )
4142
+ }
4143
+
4144
+ override func testCommandPluginBuildingCallbacks( ) async throws {
4145
+ try XCTSkipOnWindows ( because: " TSCBasic/Path.swift:969: Assertion failed, https://github.com/swiftlang/swift-package-manager/issues/8602 " )
4146
+ try await super. testCommandPluginBuildingCallbacks ( )
4103
4147
}
4104
4148
4105
4149
override func testMigrateCommand( ) async throws {
0 commit comments