Skip to content

Commit c6ec569

Browse files
committed
Tests: Minor tweaks in Swift Build related tests
1 parent c8d439a commit c6ec569

File tree

6 files changed

+41
-104
lines changed

6 files changed

+41
-104
lines changed

Tests/BuildTests/BuildPlanTests.swift

+6-16
Original file line numberDiff line numberDiff line change
@@ -6911,23 +6911,15 @@ class BuildPlanTestCase: BuildSystemProviderTestCase {
69116911
}
69126912
}
69136913

6914-
class BuildPlanNativeTests: BuildPlanTestCase {
6915-
override open var buildSystemProvider: BuildSystemProvider.Kind {
6916-
return .native
6917-
}
6918-
6919-
override func testDuplicateProductNamesWithNonDefaultLibsThrowError() async throws {
6920-
try await super.testDuplicateProductNamesWithNonDefaultLibsThrowError()
6914+
final class BuildPlanNativeTests: BuildPlanTestCase {
6915+
override public var buildSystemProvider: BuildSystemProvider.Kind {
6916+
.native
69216917
}
69226918
}
69236919

6924-
class BuildPlanSwiftBuildTests: BuildPlanTestCase {
6925-
override open var buildSystemProvider: BuildSystemProvider.Kind {
6926-
return .swiftbuild
6927-
}
6928-
6929-
override func testDuplicateProductNamesWithNonDefaultLibsThrowError() async throws {
6930-
try await super.testDuplicateProductNamesWithNonDefaultLibsThrowError()
6920+
final class BuildPlanSwiftBuildTests: BuildPlanTestCase {
6921+
override public var buildSystemProvider: BuildSystemProvider.Kind {
6922+
.swiftbuild
69316923
}
69326924

69336925
override func testTargetsWithPackageAccess() async throws {
@@ -6948,8 +6940,6 @@ class BuildPlanSwiftBuildTests: BuildPlanTestCase {
69486940
throw XCTSkip("Skipping SwiftBuild testing on Amazon Linux because of platform issues.")
69496941
}
69506942
#endif
6951-
69526943
try await super.testPackageNameFlag()
69536944
}
6954-
69556945
}

Tests/CommandsTests/APIDiffTests.swift

+6-17
Original file line numberDiff line numberDiff line change
@@ -455,25 +455,14 @@ class APIDiffTestCase: CommandsBuildProviderTestCase {
455455
}
456456
}
457457

458-
class APIDiffNativeTests: APIDiffTestCase {
459-
460-
override open var buildSystemProvider: BuildSystemProvider.Kind {
461-
return .native
462-
}
463-
464-
override func skipIfApiDigesterUnsupportedOrUnset() throws {
465-
try super.skipIfApiDigesterUnsupportedOrUnset()
458+
final class APIDiffNativeTests: APIDiffTestCase {
459+
override public var buildSystemProvider: BuildSystemProvider.Kind {
460+
.native
466461
}
467-
468462
}
469463

470-
class APIDiffSwiftBuildTests: APIDiffTestCase {
471-
472-
override open var buildSystemProvider: BuildSystemProvider.Kind {
473-
return .swiftbuild
474-
}
475-
476-
override func skipIfApiDigesterUnsupportedOrUnset() throws {
477-
try super.skipIfApiDigesterUnsupportedOrUnset()
464+
final class APIDiffSwiftBuildTests: APIDiffTestCase {
465+
override public var buildSystemProvider: BuildSystemProvider.Kind {
466+
.swiftbuild
478467
}
479468
}

Tests/CommandsTests/BuildCommandTests.swift

+11-23
Original file line numberDiff line numberDiff line change
@@ -782,27 +782,17 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase {
782782

783783
}
784784

785-
786-
class BuildCommandNativeTests: BuildCommandTestCases {
787-
788-
override open var buildSystemProvider: BuildSystemProvider.Kind {
789-
return .native
790-
}
791-
792-
override func testUsage() async throws {
793-
try await super.testUsage()
785+
final class BuildCommandNativeTests: BuildCommandTestCases {
786+
override public var buildSystemProvider: BuildSystemProvider.Kind {
787+
.native
794788
}
795789
}
796790

797791
#if os(macOS)
798-
// Xcode build system tests can only function on macOS
799-
class BuildCommandXcodeTests: BuildCommandTestCases {
800-
override open var buildSystemProvider: BuildSystemProvider.Kind {
801-
return .xcode
802-
}
803-
804-
override func testUsage() async throws {
805-
try await super.testUsage()
792+
/// Xcode build system tests can only function on macOS.
793+
final class BuildCommandXcodeTests: BuildCommandTestCases {
794+
override public var buildSystemProvider: BuildSystemProvider.Kind {
795+
.xcode
806796
}
807797

808798
override func testAutomaticParseableInterfacesWithLibraryEvolution() async throws {
@@ -855,10 +845,9 @@ class BuildCommandXcodeTests: BuildCommandTestCases {
855845
}
856846
#endif
857847

858-
class BuildCommandSwiftBuildTests: BuildCommandTestCases {
859-
860-
override open var buildSystemProvider: BuildSystemProvider.Kind {
861-
return .swiftbuild
848+
final class BuildCommandSwiftBuildTests: BuildCommandTestCases {
849+
override public var buildSystemProvider: BuildSystemProvider.Kind {
850+
.swiftbuild
862851
}
863852

864853
override func testNonReachableProductsAndTargetsFunctional() async throws {
@@ -892,7 +881,7 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases {
892881
override func testImportOfMissedDepWarning() async throws {
893882
throw XCTSkip("SWBINTTODO: Test fails because the warning message regarding missing imports is expected to be more verbose and actionable at the SwiftPM level with mention of the involved targets. This needs to be investigated. See case targetDiagnostic(TargetDiagnosticInfo) as a message type that may help.")
894883
}
895-
884+
896885
override func testProductAndTarget() async throws {
897886
throw XCTSkip("SWBINTTODO: Test fails because there isn't a clear warning message about the lib1 being an automatic product and that the default product is being built instead. This needs to be investigated")
898887
}
@@ -946,5 +935,4 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases {
946935
try await super.testBuildCompleteMessage()
947936
#endif
948937
}
949-
950938
}

Tests/CommandsTests/PackageCommandTests.swift

+6-17
Original file line numberDiff line numberDiff line change
@@ -3836,26 +3836,15 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase {
38363836
}
38373837
}
38383838

3839-
3840-
class PackageCommandNativeTests: PackageCommandTestCase {
3841-
3842-
override open var buildSystemProvider: BuildSystemProvider.Kind {
3843-
return .native
3844-
}
3845-
3846-
override func testNoParameters() async throws {
3847-
try await super.testNoParameters()
3839+
final class PackageCommandNativeTests: PackageCommandTestCase {
3840+
override public var buildSystemProvider: BuildSystemProvider.Kind {
3841+
.native
38483842
}
38493843
}
38503844

3851-
class PackageCommandSwiftBuildTests: PackageCommandTestCase {
3852-
3853-
override open var buildSystemProvider: BuildSystemProvider.Kind {
3854-
return .swiftbuild
3855-
}
3856-
3857-
override func testNoParameters() async throws {
3858-
try await super.testNoParameters()
3845+
final class PackageCommandSwiftBuildTests: PackageCommandTestCase {
3846+
override public var buildSystemProvider: BuildSystemProvider.Kind {
3847+
.swiftbuild
38593848
}
38603849

38613850
override func testCommandPluginBuildingCallbacks() async throws {

Tests/CommandsTests/RunCommandTests.swift

+6-15
Original file line numberDiff line numberDiff line change
@@ -234,24 +234,15 @@ class RunCommandTestCase: CommandsBuildProviderTestCase {
234234

235235
}
236236

237-
class RunCommandNativeTests: RunCommandTestCase {
238-
override open var buildSystemProvider: BuildSystemProvider.Kind {
239-
return .native
240-
}
241-
242-
override func testUsage() async throws {
243-
try await super.testUsage()
237+
final class RunCommandNativeTests: RunCommandTestCase {
238+
override public var buildSystemProvider: BuildSystemProvider.Kind {
239+
.native
244240
}
245241
}
246242

247-
248-
class RunCommandSwiftBuildTests: RunCommandTestCase {
249-
override open var buildSystemProvider: BuildSystemProvider.Kind {
250-
return .swiftbuild
251-
}
252-
253-
override func testUsage() async throws {
254-
try await super.testUsage()
243+
final class RunCommandSwiftBuildTests: RunCommandTestCase {
244+
override public var buildSystemProvider: BuildSystemProvider.Kind {
245+
.swiftbuild
255246
}
256247

257248
override func testMultipleExecutableAndExplicitExecutable() async throws {

Tests/CommandsTests/TestCommandTests.swift

+6-16
Original file line numberDiff line numberDiff line change
@@ -601,27 +601,17 @@ class TestCommandTestCase: CommandsBuildProviderTestCase {
601601
}
602602
}
603603
}
604-
605604
}
606605

607-
class TestCommandNativeTests: TestCommandTestCase {
608-
override open var buildSystemProvider: BuildSystemProvider.Kind {
609-
return .native
610-
}
611-
612-
override func testUsage() async throws {
613-
try await super.testUsage()
606+
final class TestCommandNativeTests: TestCommandTestCase {
607+
override public var buildSystemProvider: BuildSystemProvider.Kind {
608+
.native
614609
}
615610
}
616611

617-
618-
class TestCommandSwiftBuildTests: TestCommandTestCase {
619-
override open var buildSystemProvider: BuildSystemProvider.Kind {
620-
return .swiftbuild
621-
}
622-
623-
override func testUsage() async throws {
624-
try await super.testUsage()
612+
final class TestCommandSwiftBuildTests: TestCommandTestCase {
613+
override public var buildSystemProvider: BuildSystemProvider.Kind {
614+
.swiftbuild
625615
}
626616

627617
override func testFatalErrorDisplayedCorrectNumberOfTimesWhenSingleXCTestHasFatalErrorInBuildCompilation() async throws {

0 commit comments

Comments
 (0)