mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[StdlibUnittest] Don't catch ObjC exceptions on non-ObjC platforms.
My apologies!
This commit is contained in:
@@ -448,12 +448,16 @@ let _crashedPrefix = "CRASHED:"
|
|||||||
@_silgen_name("swift_stdlib_installTrapInterceptor")
|
@_silgen_name("swift_stdlib_installTrapInterceptor")
|
||||||
func _stdlib_installTrapInterceptor()
|
func _stdlib_installTrapInterceptor()
|
||||||
|
|
||||||
|
#if _runtime(_ObjC)
|
||||||
@objc protocol _StdlibUnittestNSException {
|
@objc protocol _StdlibUnittestNSException {
|
||||||
optional var name: String { get }
|
optional var name: AnyObject { get }
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
func _childProcess() {
|
func _childProcess() {
|
||||||
_stdlib_installTrapInterceptor()
|
_stdlib_installTrapInterceptor()
|
||||||
|
|
||||||
|
#if _runtime(_ObjC)
|
||||||
objc_setUncaughtExceptionHandler {
|
objc_setUncaughtExceptionHandler {
|
||||||
var stderr = _Stderr()
|
var stderr = _Stderr()
|
||||||
let maybeNSException = unsafeBitCast($0, to:_StdlibUnittestNSException.self)
|
let maybeNSException = unsafeBitCast($0, to:_StdlibUnittestNSException.self)
|
||||||
@@ -466,6 +470,8 @@ func _childProcess() {
|
|||||||
to: &stderr)
|
to: &stderr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
while let line = _stdlib_getline() {
|
while let line = _stdlib_getline() {
|
||||||
let parts = line._split(separator: ";")
|
let parts = line._split(separator: ";")
|
||||||
let testSuiteName = parts[0]
|
let testSuiteName = parts[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user