@@ -85,7 +85,7 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
85
85
86
86
87
87
if cleanAfterward {
88
- try ! await executeSwiftPackage (
88
+ try await executeSwiftPackage (
89
89
packagePath,
90
90
extraArgs: [ " clean " ] ,
91
91
buildSystem: buildSystemProvider
@@ -100,7 +100,7 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
100
100
)
101
101
} catch {
102
102
if cleanAfterward {
103
- try ! await executeSwiftPackage (
103
+ try await executeSwiftPackage (
104
104
packagePath,
105
105
extraArgs: [ " clean " ] ,
106
106
buildSystem: buildSystemProvider
@@ -233,7 +233,7 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
233
233
234
234
do {
235
235
let result = try await build ( [ " --product " , " exec1 " ] , packagePath: fullPath)
236
- XCTAssertMatch ( result. binContents, [ " exec1 " ] )
236
+ XCTAssertMatch ( result. binContents, [ . equal ( executableName ( " exec1 " ) ) ] )
237
237
XCTAssertNoMatch ( result. binContents, [ " exec2.build " ] )
238
238
}
239
239
@@ -306,6 +306,8 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
306
306
}
307
307
308
308
func testAtMainSupport( ) async throws {
309
+ try XCTSkipOnWindows ( because: " lld-link: error: undefined symbol: __declspec(dllimport) swift_addNewDSOImage, needs investigation " )
310
+
309
311
try await fixture ( name: " Miscellaneous/AtMainSupport " ) { fixturePath in
310
312
let fullPath = try resolveSymlinks ( fixturePath)
311
313
@@ -316,12 +318,12 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
316
318
317
319
do {
318
320
let result = try await build ( [ " --product " , " SwiftExecSingleFile " ] , packagePath: fullPath)
319
- XCTAssertMatch ( result. binContents, [ " SwiftExecSingleFile " ] )
321
+ XCTAssertMatch ( result. binContents, [ . equal ( executableName ( " SwiftExecSingleFile " ) ) ] )
320
322
}
321
323
322
324
do {
323
325
let result = try await build ( [ " --product " , " SwiftExecMultiFile " ] , packagePath: fullPath)
324
- XCTAssertMatch ( result. binContents, [ " SwiftExecMultiFile " ] )
326
+ XCTAssertMatch ( result. binContents, [ . equal ( executableName ( " SwiftExecMultiFile " ) ) ] )
325
327
}
326
328
}
327
329
}
@@ -343,8 +345,8 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
343
345
do {
344
346
let result = try await build ( [ " --product " , " bexec " ] , packagePath: aPath)
345
347
XCTAssertMatch ( result. binContents, [ " BTarget2.build " ] )
346
- XCTAssertMatch ( result. binContents, [ " bexec " ] )
347
- XCTAssertNoMatch ( result. binContents, [ " aexec " ] )
348
+ XCTAssertMatch ( result. binContents, [ . equal ( executableName ( " bexec " ) ) ] )
349
+ XCTAssertNoMatch ( result. binContents, [ . equal ( executableName ( " aexec " ) ) ] )
348
350
XCTAssertNoMatch ( result. binContents, [ " ATarget.build " ] )
349
351
XCTAssertNoMatch ( result. binContents, [ " BLibrary.a " ] )
350
352
@@ -380,6 +382,8 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
380
382
}
381
383
382
384
func testAutomaticParseableInterfacesWithLibraryEvolution( ) async throws {
385
+ try XCTSkipOnWindows ( because: " swift-package-manager hangs, needs investigation " )
386
+
383
387
try await fixture ( name: " Miscellaneous/LibraryEvolution " ) { fixturePath in
384
388
do {
385
389
let result = try await build ( [ ] , packagePath: fixturePath)
@@ -541,6 +545,8 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
541
545
}
542
546
543
547
func testSwiftGetVersion( ) async throws {
548
+ try XCTSkipOnWindows ( because: " SWIFT_EXEC override is not working, needs investigation " )
549
+
544
550
try await fixture ( name: " Miscellaneous/Simple " ) { fixturePath in
545
551
func findSwiftGetVersionFile( ) throws -> AbsolutePath {
546
552
let buildArenaPath = fixturePath. appending ( components: " .build " , " debug " )
@@ -678,7 +684,7 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
678
684
}
679
685
}
680
686
681
- #if !canImport(Darwin )
687
+ #if os(Linux )
682
688
func testIgnoresLinuxMain( ) async throws {
683
689
try await fixture ( name: " Miscellaneous/TestDiscovery/IgnoresLinuxMain " ) { fixturePath in
684
690
let buildResult = try await self . build ( [ " -v " , " --build-tests " , " --enable-test-discovery " ] , packagePath: fixturePath, cleanAfterward: false )
@@ -774,15 +780,10 @@ class BuildCommandNativeTests: BuildCommandTestCases {
774
780
components: " .build " ,
775
781
UserToolchain . default. targetTriple. platformBuildPathComponent
776
782
)
777
- try await XCTAssertAsyncEqual (
778
- try await self . execute ( [ " --show-bin-path " ] , packagePath: fullPath) . stdout,
779
- " \( targetPath. appending ( " debug " ) . pathString) \n "
780
- )
781
- try await XCTAssertAsyncEqual (
782
- try await self . execute ( [ " -c " , " release " , " --show-bin-path " ] , packagePath: fullPath)
783
- . stdout,
784
- " \( targetPath. appending ( " release " ) . pathString) \n "
785
- )
783
+ let debugPath = try await self . execute ( [ " --show-bin-path " ] , packagePath: fullPath) . stdout. trimmingCharacters ( in: . whitespacesAndNewlines)
784
+ XCTAssertEqual ( AbsolutePath ( debugPath) . pathString, targetPath. appending ( " debug " ) . pathString)
785
+ let releasePath = try await self . execute ( [ " -c " , " release " , " --show-bin-path " ] , packagePath: fullPath) . stdout. trimmingCharacters ( in: . whitespacesAndNewlines)
786
+ XCTAssertEqual ( AbsolutePath ( releasePath) . pathString, targetPath. appending ( " release " ) . pathString)
786
787
}
787
788
}
788
789
}
@@ -861,6 +862,7 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases {
861
862
override func testParseableInterfaces( ) async throws {
862
863
try XCTSkipIfWorkingDirectoryUnsupported ( )
863
864
865
+ try XCTSkipOnWindows ( because: " build errors, needs investigation " )
864
866
try await fixture ( name: " Miscellaneous/ParseableInterfaces " ) { fixturePath in
865
867
do {
866
868
let result = try await build ( [ " --enable-parseable-module-interfaces " ] , packagePath: fixturePath)
@@ -885,9 +887,9 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases {
885
887
UserToolchain . default. targetTriple. platformBuildPathComponent
886
888
)
887
889
let debugPath = try await self . execute ( [ " --show-bin-path " ] , packagePath: fullPath) . stdout
888
- XCTAssertMatch ( debugPath, . regex( targetPath. appending ( components: " Products " , " Debug " ) . pathString + " ( \\ -linux| \\ -Windows)? \\ n " ) )
890
+ XCTAssertMatch ( AbsolutePath ( debugPath) . pathString , . regex( targetPath. appending ( components: " Products " , " Debug " ) . escapedPathString + " ( \\ -linux| \\ -Windows)? " ) )
889
891
let releasePath = try await self . execute ( [ " -c " , " release " , " --show-bin-path " ] , packagePath: fullPath) . stdout
890
- XCTAssertMatch ( releasePath, . regex( targetPath. appending ( components: " Products " , " Release " ) . pathString + " ( \\ -linux| \\ -Windows)? \\ n " ) )
892
+ XCTAssertMatch ( AbsolutePath ( releasePath) . pathString , . regex( targetPath. appending ( components: " Products " , " Release " ) . escapedPathString + " ( \\ -linux| \\ -Windows)? " ) )
891
893
}
892
894
}
893
895
@@ -942,6 +944,7 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases {
942
944
override func testBuildSystemDefaultSettings( ) async throws {
943
945
try XCTSkipIfWorkingDirectoryUnsupported ( )
944
946
947
+ try XCTSkipOnWindows ( because: " build errors, needs investigation " )
945
948
if ProcessInfo . processInfo. environment [ " SWIFTPM_NO_SWBUILD_DEPENDENCY " ] != nil {
946
949
throw XCTSkip ( " SWIFTPM_NO_SWBUILD_DEPENDENCY is set so skipping because SwiftPM doesn't have the swift-build capability built inside. " )
947
950
}
@@ -952,6 +955,7 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases {
952
955
override func testBuildCompleteMessage( ) async throws {
953
956
try XCTSkipIfWorkingDirectoryUnsupported ( )
954
957
958
+ try XCTSkipOnWindows ( because: " Build fails on windows, needs investigation " )
955
959
try await super. testBuildCompleteMessage ( )
956
960
}
957
961
0 commit comments