Skip to content

Commit b14a7e1

Browse files
committed
Revert "Attempt solution at a custom XFail for XCTest.."
This reverts commit 3e06c8f497b33b24aefc18290d9226dea01525e6.
1 parent f3625a8 commit b14a7e1

File tree

3 files changed

+24
-100
lines changed

3 files changed

+24
-100
lines changed
Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,8 @@
11
import SPMBuildCore
22
import XCTest
33

4-
public struct XFailCaseName {
5-
let testName: String
6-
let reason: String
7-
8-
public init(_ testName: String, because reason: String) {
9-
self.testName = testName
10-
self.reason = reason
11-
}
12-
}
134
open class BuildSystemProviderTestCase: XCTestCase {
145
open var buildSystemProvider: BuildSystemProvider.Kind {
156
fatalError("\(self) does not implement \(#function)")
167
}
17-
18-
open var xFailTestCaseNames: [XFailCaseName] {
19-
return []
20-
}
21-
22-
override open func recordFailure(withDescription description: String, inFile filePath: String, atLine lineNumber: Int, expected: Bool) {
23-
// Get current test name:
24-
print("--->> In recordFailure: Test name is >>>\(self.name)<<<")
25-
26-
if self.xFailTestCaseNames.map({ item in item.testName }).contains(self.name) {
27-
// do nothing
28-
print("--->> In recordFailure: Test name is >>>\(self.name)<<< is expected to fail, so mark as passed!!")
29-
} else {
30-
super.recordFailure(
31-
withDescription: description,
32-
inFile: filePath,
33-
atLine: lineNumber,
34-
expected: expected
35-
)
36-
}
37-
}
388
}

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6880,34 +6880,17 @@ class BuildPlanSwiftBuildTests: BuildPlanTestCase {
68806880
return .swiftbuild
68816881
}
68826882

6883-
override open var xFailTestCaseNames: [XFailCaseName] {
6884-
return [
6885-
XFailCaseName(
6886-
String(describing: testDuplicateProductNamesWithNonDefaultLibsThrowError.self),
6887-
because: "This test is not expected to fail.. it should pass.",
6888-
),
6889-
XFailCaseName(
6890-
String(describing: testTargetsWithPackageAccess.self),
6891-
because: "Skip until swift build system can support this case",
6892-
),
6893-
// XFailCaseName(
6894-
// String(describing: testTestModule.self),
6895-
// because: "Skip until swift build system can support this case."
6896-
// )
6897-
]
6898-
}
6899-
69006883
override func testDuplicateProductNamesWithNonDefaultLibsThrowError() async throws {
69016884
try await super.testDuplicateProductNamesWithNonDefaultLibsThrowError()
69026885
}
69036886

6904-
// override func testTargetsWithPackageAccess() async throws {
6905-
// throw XCTSkip("Skip until swift build system can support this case.")
6906-
// }
6887+
override func testTargetsWithPackageAccess() async throws {
6888+
throw XCTSkip("Skip until swift build system can support this case.")
6889+
}
69076890

6908-
// override func testTestModule() async throws {
6909-
// throw XCTSkip("Skip until swift build system can support this case.")
6910-
// }
6891+
override func testTestModule() async throws {
6892+
throw XCTSkip("Skip until swift build system can support this case.")
6893+
}
69116894

69126895
override func testPackageNameFlag() async throws {
69136896
#if os(Windows)

Tests/CommandsTests/RunCommandTests.swift

Lines changed: 18 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import XCTest
1919

2020
import class Basics.AsyncProcess
2121

22-
class RunCommandTestCase: CommandsBuildProviderTestCase {
22+
class RunCommandTestCase: BuildSystemProviderTestCase {
2323
override func setUpWithError() throws {
2424
try XCTSkipIf(type(of: self) == RunCommandTestCase.self, "Pay no attention to the class behind the curtain.")
2525
}
@@ -291,57 +291,28 @@ class RunCommandSwiftBuildTests: RunCommandTestCase {
291291
try await super.testUsage()
292292
}
293293

294-
override open var xFailTestCaseNames: [XFailCaseName] {
295-
return [
296-
XFailCaseName(
297-
String(describing: testMultipleExecutableAndExplicitExecutable.self),
298-
because: "https://github.com/swiftlang/swift-package-manager/issues/8279: Swift run using Swift Build does not output executable content to the terminal",
299-
),
300-
XFailCaseName(
301-
String(describing: testUnknownProductAndArgumentPassing.self),
302-
because: "https://github.com/swiftlang/swift-package-manager/issues/8279: Swift run using Swift Build does not output executable content to the terminal",
303-
),
304-
XFailCaseName(
305-
String(describing: testPackageWithExcutableTargetsContainsPlatformConditionalsBuildsSuccessfullyInDebugConfig.self),
306-
because: "Test fixture fails to build",
307-
),
308-
XFailCaseName(
309-
String(describing: testPackageWithExcutableTargetsContainsPlatformConditionalsBuildsSuccessfullyInReleaseConfig.self),
310-
because: "Test fixture fails to build",
311-
),
312-
XFailCaseName(
313-
String(describing: testToolsetDebugger.self),
314-
because: "Test fixture fails to build",
315-
),
316-
XFailCaseName(
317-
String(describing: testUnreachableExecutable.self),
318-
because: "Need to investigate test failure",
319-
),
320-
]
294+
override func testMultipleExecutableAndExplicitExecutable() async throws {
295+
try XCTSkip("https://github.com/swiftlang/swift-package-manager/issues/8279: Swift run using Swift Build does not output executable content to the terminal")
321296
}
322297

323-
// override func testMultipleExecutableAndExplicitExecutable() async throws {
324-
// try XCTSkip("https://github.com/swiftlang/swift-package-manager/issues/8279: Swift run using Swift Build does not output executable content to the terminal")
325-
// }
326-
327-
// override func testUnknownProductAndArgumentPassing() async throws {
328-
// try XCTSkip("https://github.com/swiftlang/swift-package-manager/issues/8279: Swift run using Swift Build does not output executable content to the terminal")
329-
// }
298+
override func testUnknownProductAndArgumentPassing() async throws {
299+
try XCTSkip("https://github.com/swiftlang/swift-package-manager/issues/8279: Swift run using Swift Build does not output executable content to the terminal")
300+
}
330301

331-
// override func testPackageWithExcutableTargetsContainsPlatformConditionalsBuildsSuccessfullyInDebugConfig() async throws {
332-
// try XCTSkip("Test fixture fails to build")
333-
// }
302+
override func testPackageWithExcutableTargetsContainsPlatformConditionalsBuildsSuccessfullyInDebugConfig() async throws {
303+
try XCTSkip("Test fixture fails to build")
304+
}
334305

335-
// override func testPackageWithExcutableTargetsContainsPlatformConditionalsBuildsSuccessfullyInReleaseConfig() async throws {
336-
// try XCTSkip("Test fixture fails to build")
337-
// }
306+
override func testPackageWithExcutableTargetsContainsPlatformConditionalsBuildsSuccessfullyInReleaseConfig() async throws {
307+
try XCTSkip("Test fixture fails to build")
308+
}
338309

339-
// override func testToolsetDebugger() async throws {
340-
// try XCTSkip("Test fixture fails to build")
341-
// }
310+
override func testToolsetDebugger() async throws {
311+
try XCTSkip("Test fixture fails to build")
312+
}
342313

343-
// override func testUnreachableExecutable() async throws {
344-
// try XCTSkip("Need to investigate test failure")
345-
// }
314+
override func testUnreachableExecutable() async throws {
315+
try XCTSkip("Need to investigate test failure")
316+
}
346317

347318
}

0 commit comments

Comments
 (0)