Skip to content
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

Xcode12 support #40

Closed
wants to merge 1 commit into from
Closed

Xcode12 support #40

wants to merge 1 commit into from

Conversation

kenmaz
Copy link

@kenmaz kenmaz commented Jul 4, 2020

XCTestCase.recordFailure(..) method has been deprecated on Xcode12+ and it will cause compile error on Xcode12.

スクリーンショット 2020-07-05 0 41 33

To avoid that, added @available block.
In the future, XCTestCase. recordFailure(..) should be replaced with new API, XCTestCase.record(_:).

Video
https://developer.apple.com/videos/play/wwdc2020/10687/
Document
https://developer.apple.com/documentation/xctest/xctestcase/3546549-record

@amine2233
Copy link

you can use this code instead of just checking if you are on macosx 10.13

if #available(OSX 10.13, *) {
        testCase.recordFailure(withDescription: "\(name): \(failure.reason)", inFile: failure.file, atLine: failure.line, expected: false)
    } else {
        let location = XCTSourceCodeLocation(filePath: failure.file, lineNumber: failure.line)
        let issue = XCTIssue(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: [])
        testCase.record(issue)
    }

@amine2233
Copy link

please it's very important to merge this pr and create a new release, because some project needed to run on Xcode 12 and on macOS Big Sur like XcodeGen

@aaronbrethorst
Copy link

Hey @kylef - any word?

@kylef
Copy link
Owner

kylef commented Aug 9, 2020

These changes would render Spectre test failures as successes with the Xcode reporter in many cases. This change won't be accepted in its current state, this must be fixed before this change can be considered.

@kylef kylef closed this in ca16256 Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants