diff options
Diffstat (limited to 'platform/darwin/test/MGLTestAssertionHandler.h')
-rw-r--r-- | platform/darwin/test/MGLTestAssertionHandler.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLTestAssertionHandler.h b/platform/darwin/test/MGLTestAssertionHandler.h new file mode 100644 index 0000000000..f1aa39921e --- /dev/null +++ b/platform/darwin/test/MGLTestAssertionHandler.h @@ -0,0 +1,18 @@ +#import <Foundation/Foundation.h> +#import <XCTest/XCTest.h> + +NS_ASSUME_NONNULL_BEGIN + +// Use to catch or log assertions that occur in dispatch blocks, timers or +// other asynchronous operations. +@interface MGLTestAssertionHandler : NSAssertionHandler + +- (instancetype)initWithTestCase:(XCTestCase *)testCase; +@property (nonatomic, weak) XCTestCase *testCase; + +// If YES, use `_XCTPreformattedFailureHandler` to "fail" the test, +// otherwise log the assert. +@property (nonatomic) BOOL shouldFail; +@end + +NS_ASSUME_NONNULL_END |