-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Attempt solution at a custom XFail for XCTest.."
This reverts commit 3e06c8f497b33b24aefc18290d9226dea01525e6.
- Loading branch information
Showing
3 changed files
with
24 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,8 @@ | ||
import SPMBuildCore | ||
import XCTest | ||
|
||
public struct XFailCaseName { | ||
let testName: String | ||
let reason: String | ||
|
||
public init(_ testName: String, because reason: String) { | ||
self.testName = testName | ||
self.reason = reason | ||
} | ||
} | ||
open class BuildSystemProviderTestCase: XCTestCase { | ||
open var buildSystemProvider: BuildSystemProvider.Kind { | ||
fatalError("\(self) does not implement \(#function)") | ||
} | ||
|
||
open var xFailTestCaseNames: [XFailCaseName] { | ||
return [] | ||
} | ||
|
||
override open func recordFailure(withDescription description: String, inFile filePath: String, atLine lineNumber: Int, expected: Bool) { | ||
// Get current test name: | ||
print("--->> In recordFailure: Test name is >>>\(self.name)<<<") | ||
|
||
if self.xFailTestCaseNames.map({ item in item.testName }).contains(self.name) { | ||
// do nothing | ||
print("--->> In recordFailure: Test name is >>>\(self.name)<<< is expected to fail, so mark as passed!!") | ||
} else { | ||
super.recordFailure( | ||
withDescription: description, | ||
inFile: filePath, | ||
atLine: lineNumber, | ||
expected: expected | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters