Skip to content

Commit

Permalink
Merge pull request #545 from Quick/update-cwlpreconditiontesting
Browse files Browse the repository at this point in the history
[7.x] Update CwlPreconditionTesting and utilize _swift_reportFatalErrorsToDebugger
  • Loading branch information
ikesyo committed Jun 25, 2018
2 parents d82e6d6 + 13f2cc8 commit 83846b8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
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
@@ -1 +1 @@
github "mattgallagher/CwlPreconditionTesting" "cb7ab89273cfd0725a7a2f865cc6fc560a9b9083"
github "mattgallagher/CwlPreconditionTesting" "1e62a726d54c743f4585233f08fcaac7307319b5"
2 changes: 1 addition & 1 deletion Cartfile.resolved
@@ -1,2 +1,2 @@
github "mattgallagher/CwlCatchException" "b14c111e9b33cd142bd4bc75c482cfd5c3490923"
github "mattgallagher/CwlPreconditionTesting" "cb7ab89273cfd0725a7a2f865cc6fc560a9b9083"
github "mattgallagher/CwlPreconditionTesting" "1e62a726d54c743f4585233f08fcaac7307319b5"
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
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
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

0 comments on commit 83846b8

Please sign in to comment.