Add iOS client hang test

Summary: Check that it never hangs or crashes during startup

Reviewed By: priteshrnandgaonkar

Differential Revision: D10034630

fbshipit-source-id: b69ce9e6f91a5499a084c4d7328e6934ec92ece4
This commit is contained in:
John Knox
2018-09-26 07:22:23 -07:00
committed by Facebook Github Bot
parent 7e296467d2
commit 3118814ddc
2 changed files with 30 additions and 3 deletions

View File

@@ -61,14 +61,15 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin;
deviceName = [NSString stringWithFormat:@"%@ %@", [[UIDevice currentDevice] model], @"Simulator"];
#endif
static const std::string UNKNOWN = std::string("unknown");
facebook::flipper::FlipperClient::init({
{
"localhost",
"iOS",
[deviceName UTF8String],
"unknown",
[appName UTF8String],
[appId UTF8String],
UNKNOWN,
[appName UTF8String] ?: UNKNOWN,
[appId UTF8String] ?: UNKNOWN,
[privateAppDirectory UTF8String],
},
sonarThread.getEventBase(),

View File

@@ -0,0 +1,26 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import <XCTest/XCTest.h>
#if FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
@interface FlipperClientTests : XCTestCase
@end
@implementation FlipperClientTests
- (void)testStartingClientDoesntCrashOrHang {
FlipperClient *client = [FlipperClient sharedClient];
[client start];
}
@end
#endif