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

[7.x] Update CwlPreconditionTesting and utilize _swift_reportFatalErrorsToDebugger #545

Merged
merged 2 commits into from
Jun 25, 2018
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
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ matrix:
- os: osx
env: TYPE=macos
osx_image: xcode9
- os: osx
env: TYPE=macos
osx_image: xcode9.1
- os: osx
env: TYPE=macos
osx_image: xcode9.2
- os: osx
env: TYPE=macos
osx_image: xcode9.3
- os: osx
env: TYPE=macos
osx_image: xcode9.4
- os: osx
env: TYPE=swiftpm
- os: osx
Expand Down
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "mattgallagher/CwlPreconditionTesting" "cb7ab89273cfd0725a7a2f865cc6fc560a9b9083"
github "mattgallagher/CwlPreconditionTesting" "1e62a726d54c743f4585233f08fcaac7307319b5"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "mattgallagher/CwlCatchException" "b14c111e9b33cd142bd4bc75c482cfd5c3490923"
github "mattgallagher/CwlPreconditionTesting" "cb7ab89273cfd0725a7a2f865cc6fc560a9b9083"
github "mattgallagher/CwlPreconditionTesting" "1e62a726d54c743f4585233f08fcaac7307319b5"
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#import <Foundation/Foundation.h>

extern bool _swift_reportFatalErrorsToDebugger;

//! Project version number for CwlUtils.
FOUNDATION_EXPORT double CwlPreconditionTestingVersionNumber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#import <Foundation/Foundation.h>

extern bool _swift_reportFatalErrorsToDebugger;

//! Project version number for CwlUtils.
FOUNDATION_EXPORT double CwlPreconditionTesting_POSIXVersionNumber;

Expand Down
11 changes: 11 additions & 0 deletions Sources/Nimble/Adapters/NimbleXCTestHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,23 @@ class NimbleXCTestUnavailableHandler: AssertionHandler {

private(set) var currentTestCase: XCTestCase?

private var stashed_swift_reportFatalErrorsToDebugger: Bool = false

@objc func testCaseWillStart(_ testCase: XCTestCase) {
#if swift(>=3.2)
stashed_swift_reportFatalErrorsToDebugger = _swift_reportFatalErrorsToDebugger
_swift_reportFatalErrorsToDebugger = false
#endif

currentTestCase = testCase
}

@objc func testCaseDidFinish(_ testCase: XCTestCase) {
currentTestCase = nil

#if swift(>=3.2)
_swift_reportFatalErrorsToDebugger = stashed_swift_reportFatalErrorsToDebugger
#endif
}
}
#endif
Expand Down