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

Add fix for Xcode 12.5 #46

Merged
merged 1 commit into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/xcode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ jobs:
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app'
strategy:
matrix:
xcode: ['10.3', '11.3.1', '11.6', '12_beta']
# xcode 12.5 is not available yet, as it runs on macos-11 and macos 11 is in a private pool
# https://github.com/actions/virtual-environments/issues/2486
xcode: ['10.3', '11.3.1', '11.6', '12_beta', '12.4']
steps:
- uses: actions/checkout@v2
- run: rm -fr IntegrationTests # swift package will generate wrong package
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Support for Swift < 4.2 has been dropped.

### Bug Fixes

- Use `as` to cast `XCTIssueReference` to `XCTIssue` so it will compile on Xcode 12.5

### Enhancements

- Reporter type can be set via an environment variable. For example, to use dot
Expand Down
4 changes: 4 additions & 0 deletions Sources/Spectre/XCTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ class XcodeReporter: ContextReporter {
#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
Expand Down