-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Tests: Minor tweaks in Swift Build related tests #8473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6977,23 +6977,15 @@ class BuildPlanTestCase: BuildSystemProviderTestCase { | |
} | ||
} | ||
|
||
class BuildPlanNativeTests: BuildPlanTestCase { | ||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .native | ||
} | ||
|
||
override func testDuplicateProductNamesWithNonDefaultLibsThrowError() async throws { | ||
try await super.testDuplicateProductNamesWithNonDefaultLibsThrowError() | ||
final class BuildPlanNativeTests: BuildPlanTestCase { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Marked all these subclasses |
||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.native | ||
} | ||
} | ||
|
||
class BuildPlanSwiftBuildTests: BuildPlanTestCase { | ||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .swiftbuild | ||
} | ||
|
||
override func testDuplicateProductNamesWithNonDefaultLibsThrowError() async throws { | ||
try await super.testDuplicateProductNamesWithNonDefaultLibsThrowError() | ||
final class BuildPlanSwiftBuildTests: BuildPlanTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.swiftbuild | ||
} | ||
|
||
override func testTargetsWithPackageAccess() async throws { | ||
|
@@ -7014,8 +7006,6 @@ class BuildPlanSwiftBuildTests: BuildPlanTestCase { | |
throw XCTSkip("Skipping SwiftBuild testing on Amazon Linux because of platform issues.") | ||
} | ||
#endif | ||
|
||
try await super.testPackageNameFlag() | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -455,25 +455,14 @@ class APIDiffTestCase: CommandsBuildProviderTestCase { | |
} | ||
} | ||
|
||
class APIDiffNativeTests: APIDiffTestCase { | ||
|
||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .native | ||
} | ||
|
||
override func skipIfApiDigesterUnsupportedOrUnset() throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try super.skipIfApiDigesterUnsupportedOrUnset() | ||
final class APIDiffNativeTests: APIDiffTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.native | ||
} | ||
|
||
} | ||
|
||
class APIDiffSwiftBuildTests: APIDiffTestCase { | ||
|
||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .swiftbuild | ||
} | ||
|
||
override func skipIfApiDigesterUnsupportedOrUnset() throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try super.skipIfApiDigesterUnsupportedOrUnset() | ||
final class APIDiffSwiftBuildTests: APIDiffTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.swiftbuild | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -782,27 +782,17 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase { | |
|
||
} | ||
|
||
|
||
class BuildCommandNativeTests: BuildCommandTestCases { | ||
|
||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .native | ||
} | ||
|
||
override func testUsage() async throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try await super.testUsage() | ||
final class BuildCommandNativeTests: BuildCommandTestCases { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.native | ||
} | ||
} | ||
|
||
#if os(macOS) | ||
// Xcode build system tests can only function on macOS | ||
class BuildCommandXcodeTests: BuildCommandTestCases { | ||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .xcode | ||
} | ||
|
||
override func testUsage() async throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try await super.testUsage() | ||
/// Xcode build system tests can only function on macOS. | ||
final class BuildCommandXcodeTests: BuildCommandTestCases { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.xcode | ||
} | ||
|
||
override func testAutomaticParseableInterfacesWithLibraryEvolution() async throws { | ||
|
@@ -855,10 +845,9 @@ class BuildCommandXcodeTests: BuildCommandTestCases { | |
} | ||
#endif | ||
|
||
class BuildCommandSwiftBuildTests: BuildCommandTestCases { | ||
|
||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .swiftbuild | ||
final class BuildCommandSwiftBuildTests: BuildCommandTestCases { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.swiftbuild | ||
} | ||
|
||
override func testNonReachableProductsAndTargetsFunctional() async throws { | ||
|
@@ -892,7 +881,7 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases { | |
override func testImportOfMissedDepWarning() async throws { | ||
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.") | ||
} | ||
|
||
override func testProductAndTarget() async throws { | ||
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") | ||
} | ||
|
@@ -946,5 +935,4 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases { | |
try await super.testBuildCompleteMessage() | ||
#endif | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3836,26 +3836,15 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase { | |
} | ||
} | ||
|
||
|
||
class PackageCommandNativeTests: PackageCommandTestCase { | ||
|
||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .native | ||
} | ||
|
||
override func testNoParameters() async throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try await super.testNoParameters() | ||
final class PackageCommandNativeTests: PackageCommandTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.native | ||
} | ||
} | ||
|
||
class PackageCommandSwiftBuildTests: PackageCommandTestCase { | ||
|
||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .swiftbuild | ||
} | ||
|
||
override func testNoParameters() async throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override to ensure the tests gets "instantiated" on linux when all other tests are "fixed". |
||
try await super.testNoParameters() | ||
final class PackageCommandSwiftBuildTests: PackageCommandTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.swiftbuild | ||
} | ||
|
||
override func testCommandPluginBuildingCallbacks() async throws { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,24 +234,15 @@ class RunCommandTestCase: CommandsBuildProviderTestCase { | |
|
||
} | ||
|
||
class RunCommandNativeTests: RunCommandTestCase { | ||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .native | ||
} | ||
|
||
override func testUsage() async throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try await super.testUsage() | ||
final class RunCommandNativeTests: RunCommandTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.native | ||
} | ||
} | ||
|
||
|
||
class RunCommandSwiftBuildTests: RunCommandTestCase { | ||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .swiftbuild | ||
} | ||
|
||
override func testUsage() async throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try await super.testUsage() | ||
final class RunCommandSwiftBuildTests: RunCommandTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.swiftbuild | ||
} | ||
|
||
override func testMultipleExecutableAndExplicitExecutable() async throws { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -601,27 +601,17 @@ class TestCommandTestCase: CommandsBuildProviderTestCase { | |
} | ||
} | ||
} | ||
|
||
} | ||
|
||
class TestCommandNativeTests: TestCommandTestCase { | ||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .native | ||
} | ||
|
||
override func testUsage() async throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try await super.testUsage() | ||
final class TestCommandNativeTests: TestCommandTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.native | ||
} | ||
} | ||
|
||
|
||
class TestCommandSwiftBuildTests: TestCommandTestCase { | ||
override open var buildSystemProvider: BuildSystemProvider.Kind { | ||
return .swiftbuild | ||
} | ||
|
||
override func testUsage() async throws { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chore (blocking): please re-add this override. |
||
try await super.testUsage() | ||
final class TestCommandSwiftBuildTests: TestCommandTestCase { | ||
override public var buildSystemProvider: BuildSystemProvider.Kind { | ||
.swiftbuild | ||
} | ||
|
||
override func testFatalErrorDisplayedCorrectNumberOfTimesWhenSingleXCTestHasFatalErrorInBuildCompilation() async throws { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all overrides that just call back the corresponding super class method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chore (blocking): Please re-add the override as it was needed to ensure the XCTests on linux instantiate all the tests in the subclass.
@cmcgee1024 can provide additional information as to why it was originally added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, wasn't aware of that Linux hack, sorry :-(
So to be clear: all Linux test suites need to override all test cases... and then call
super
? If so, are we sure we actually did this hack everywhere? For instanceBuildPlanSwiftBuildTests
has dozen of tests but only two are overridden like this.CC @cmcgee1024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from my understanding, only 1 test needs to be overridden to have XCTest "populate" all the tests in the subclass.