Files
nixpkgs/pkgs/by-name/xc/xcodegen/0001-spectre-xct-record.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

35 lines
1.7 KiB
Diff

diff --git a/Sources/Spectre/XCTest.swift b/Sources/Spectre/XCTest.swift
index 3704436..e759f14 100644
--- a/Sources/Spectre/XCTest.swift
+++ b/Sources/Spectre/XCTest.swift
@@ -31,28 +31,6 @@ class XcodeReporter: ContextReporter {
func addDisabled(_ name: String) {}
func addFailure(_ name: String, failure: FailureType) {
- // Xcode 12 removed `recordFailure` and replaced with `record(_:)`
- #if swift(>=4.2)
- // The `compiler` statement was added in swift 4.2, so it needs to be in a separate statement to retain
- // compatibility with 4.x.
- #if compiler(>=5.3) && os(macOS)
- let location = XCTSourceCodeLocation(filePath: failure.file, lineNumber: failure.line)
- #if Xcode
- // As of Xcode 12.0.1, XCTIssue is unavailable even though it is documented:
- // https://developer.apple.com/documentation/xctest/xctissue
- // When building with `swift build`, it is available. Perhaps the xctest overlay behaves differently between the two.
- let issue = XCTIssueReference(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: [])
- #else
- let issue = XCTIssue(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: [])
- #endif
- #if compiler(>=5.4)
- testCase.record(issue as XCTIssue)
- #else
- testCase.record(issue)
- #endif
- #else
testCase.recordFailure(withDescription: "\(name): \(failure.reason)", inFile: failure.file, atLine: failure.line, expected: false)
- #endif
- #endif
}
}
\ No newline at end of file