Skip to content

Commit

Permalink
Move tests to Xcode9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
javache committed Jan 6, 2016
1 parent 7d70b86 commit 695eeb0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: objective-c

osx_image: xcode7
osx_image: xcode7.2

cache:
directories:
Expand Down
2 changes: 2 additions & 0 deletions Examples/UIExplorer/UIExplorerUnitTests/RCTBridgeTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ - (void)setUp {}

- (instancetype)init
{
NSLog(@"New TestExecutor created");
if (self = [super init]) {
_injectedStuff = [NSMutableDictionary dictionary];
}
Expand Down Expand Up @@ -92,6 +93,7 @@ - (void)injectJSONText:(NSString *)script
asGlobalObjectNamed:(NSString *)objectName
callback:(RCTJavaScriptCompleteBlock)onComplete
{
NSLog(@"Injecting config with name %@", objectName);
_injectedStuff[objectName] = script;
onComplete(nil);
}
Expand Down
9 changes: 7 additions & 2 deletions React/Base/RCTBatchedBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ - (instancetype)initWithParentBridge:(RCTBridge *)bridge

- (void)start
{
NSLog(@"RCTBatchedBridge setup");

dispatch_queue_t bridgeQueue = dispatch_queue_create("com.facebook.react.RCTBridgeQueue", DISPATCH_QUEUE_CONCURRENT);

dispatch_group_t initModulesAndLoadSource = dispatch_group_create();
Expand Down Expand Up @@ -141,8 +143,8 @@ - (void)start

// Asynchronously gather the module config
dispatch_group_async(setupJSExecutorAndModuleConfig, bridgeQueue, ^{
NSLog(@"Module config generation");
if (weakSelf.isValid) {

RCTPerformanceLoggerStart(RCTPLNativeModulePrepareConfig);
config = [weakSelf moduleConfig];
RCTPerformanceLoggerEnd(RCTPLNativeModulePrepareConfig);
Expand All @@ -151,11 +153,12 @@ - (void)start
NSInteger total = [[_moduleDataByID valueForKeyPath:@"@sum.hasInstance"] integerValue];
_asyncInitializedModules = total - _syncInitializedModules;
#endif

}
});

dispatch_group_notify(setupJSExecutorAndModuleConfig, bridgeQueue, ^{
NSLog(@"Module config injection");

// We're not waiting for this to complete to leave dispatch group, since
// injectJSONConfiguration and executeSourceCode will schedule operations
// on the same queue anyway.
Expand Down Expand Up @@ -409,9 +412,11 @@ - (void)injectJSONConfiguration:(NSString *)configJSON
onComplete:(void (^)(NSError *))onComplete
{
if (!self.valid) {
NSLog(@"Bridge is not valid, not injecting JSON");
return;
}

NSLog(@"Bridge _is_ valid, injecting JSON to %@", _javaScriptExecutor);
[_javaScriptExecutor injectJSONText:configJSON
asGlobalObjectNamed:@"__fbBatchedBridgeConfig"
callback:onComplete];
Expand Down
2 changes: 2 additions & 0 deletions React/Executors/RCTJSCExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ - (void)injectJSONText:(NSString *)script
asGlobalObjectNamed:(NSString *)objectName
callback:(RCTJavaScriptCompleteBlock)onComplete
{
NSLog(@"RCTJSCExecutor: injectJSONText");

if (RCT_DEBUG) {
RCTAssert(RCTJSONParse(script, NULL) != nil, @"%@ wasn't valid JSON!", script);
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Abort the mission if any command fails
set -e
set -x

SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT=$(dirname $SCRIPTS)
Expand Down Expand Up @@ -58,9 +59,8 @@ npm unpublish react-native-cli --force
npm publish $ROOT
npm publish $ROOT/react-native-cli


npm install -g react-native-cli
react-native init EndToEndTest
react-native init EndToEndTest --verbose
cd EndToEndTest/ios

# Make sure we installed local version of react-native
Expand Down
2 changes: 1 addition & 1 deletion scripts/objc-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ trap cleanup EXIT
SERVER_PID=$!
xctool \
-project Examples/UIExplorer/UIExplorer.xcodeproj \
-scheme UIExplorer -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=9.0' \
-scheme UIExplorer -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=9.2' \
test

0 comments on commit 695eeb0

Please sign in to comment.