@@ -2802,8 +2802,16 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
28022802 // Only run the test if the environment in which we're running actually supports Swift concurrency (which the plugin APIs require).
28032803 try XCTSkipIf ( !UserToolchain. default. supportsSwiftConcurrency ( ) , " skipping because test environment doesn't support concurrency " )
28042804
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 " ]
28072815
28082816 func AssertIsExecutableFile( _ fixturePath: AbsolutePath , file: StaticString = #filePath, line: UInt = #line) {
28092817 XCTAssert (
@@ -2837,6 +2845,10 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
28372845 AssertNotExists ( fixturePath. appending ( components: releaseTarget) )
28382846 }
28392847
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+
28402852 // If the plugin requests a release binary, that is what will be built, regardless of overall configuration
28412853 try await fixture ( name: " Miscellaneous/Plugins/CommandPluginTestStub " ) { fixturePath in
28422854 let _ = try await self . execute ( [ " -c " , " debug " , " build-target " , " build-release " ] , packagePath: fixturePath)
@@ -2868,6 +2880,8 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
28682880 await XCTAssertAsyncNoThrow ( try await self . execute ( [ " -c " , " debug " , " check-testability " , " InternalModule " , " debug " , " true " ] , packagePath: fixturePath) )
28692881 }
28702882
2883+ if buildSystemProvider == . swiftbuild && ProcessInfo . hostOperatingSystem != . macOS { throw XCTSkip ( " Failed to find dsymutil tool: https://github.com/swiftlang/swift-package-manager/issues/8862 " ) }
2884+
28712885 // Overall configuration: debug, plugin build request: release -> without testability
28722886 try await fixture ( name: " Miscellaneous/Plugins/CommandPluginTestStub " ) { fixturePath in
28732887 await XCTAssertAsyncNoThrow ( try await self . execute ( [ " -c " , " debug " , " check-testability " , " InternalModule " , " release " , " false " ] , packagePath: fixturePath) )
@@ -2914,7 +2928,8 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
29142928 XCTAssertMatch ( stdout, isEmpty)
29152929 // Filter some unrelated output that could show up on stderr.
29162930 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 " )
29182933 XCTAssertMatch ( filteredStderr, isEmpty)
29192934 }
29202935
@@ -2924,7 +2939,8 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
29242939 XCTAssertMatch ( stdout, containsLogtext)
29252940 // Filter some unrelated output that could show up on stderr.
29262941 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 " )
29282944 XCTAssertMatch ( filteredStderr, isEmpty)
29292945 }
29302946
@@ -3462,9 +3478,11 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
34623478 let ( stdout, _) = try await self . execute ( [ " my-build-tester " , " --product " , " MyExecutable " , " --print-commands " ] , packagePath: packageDir)
34633479 XCTAssertMatch ( stdout, . contains( " Building for debugging... " ) )
34643480 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+ }
34683486 XCTAssertMatch ( stdout, . contains( " succeeded: true " ) )
34693487 switch buildSystemProvider {
34703488 case . native:
@@ -3483,7 +3501,9 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
34833501 XCTAssertMatch ( stdout, . contains( " Building for production... " ) )
34843502 XCTAssertNoMatch ( stdout, . contains( " Building for debug... " ) )
34853503 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+ }
34873507 XCTAssertMatch ( stdout, . contains( " succeeded: true " ) )
34883508 switch buildSystemProvider {
34893509 case . native:
@@ -3494,6 +3514,11 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
34943514 XCTFail ( " unimplemented assertion for --build-system xcode " )
34953515 }
34963516 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
34973522 }
34983523
34993524 // Invoke the plugin with parameters choosing a verbose build of MyStaticLibrary for release.
@@ -3502,7 +3527,9 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
35023527 XCTAssertMatch ( stdout, . contains( " Building for production... " ) )
35033528 XCTAssertNoMatch ( stdout, . contains( " Building for debug... " ) )
35043529 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+ }
35063533 XCTAssertMatch ( stdout, . contains( " succeeded: true " ) )
35073534 switch buildSystemProvider {
35083535 case . native:
@@ -3513,6 +3540,11 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
35133540 XCTFail ( " unimplemented assertion for --build-system xcode " )
35143541 }
35153542 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
35163548 }
35173549
35183550 // Invoke the plugin with parameters choosing a verbose build of MyDynamicLibrary for release.
@@ -3521,7 +3553,9 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
35213553 XCTAssertMatch ( stdout, . contains( " Building for production... " ) )
35223554 XCTAssertNoMatch ( stdout, . contains( " Building for debug... " ) )
35233555 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+ }
35253559 XCTAssertMatch ( stdout, . contains( " succeeded: true " ) )
35263560 switch buildSystemProvider {
35273561 case . native:
@@ -3536,6 +3570,11 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
35363570 XCTFail ( " unimplemented assertion for --build-system xcode " )
35373571 }
35383572 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
35393578 }
35403579 }
35413580 }
@@ -4097,9 +4136,14 @@ class PackageCommandSwiftBuildTests: PackageCommandTestCase {
40974136 override func testNoParameters( ) async throws {
40984137 try await super. testNoParameters ( )
40994138 }
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 ( )
41034147 }
41044148
41054149 override func testMigrateCommand( ) async throws {
0 commit comments