Ver código fonte

try to fix issue with xcode 8 tests on travis caused by xcpretty

Fabian Ehrentraud 8 anos atrás
pai
commit
1c150861af
1 arquivos alterados com 10 adições e 2 exclusões
  1. 10 2
      Tests/MasonryTestsLoader/CASAppDelegate.m

+ 10 - 2
Tests/MasonryTestsLoader/CASAppDelegate.m

@@ -11,8 +11,16 @@
 @implementation CASAppDelegate
 
 + (void)initialize {
-    [[NSUserDefaults standardUserDefaults] setValue:@"XCTestLog,GcovTestObserver"
-                                             forKey:@"XCTestObserverClass"];
+	// https://github.com/fastlane/fastlane/issues/3886#issuecomment-224884332
+	// XCode 7.3 introduced a bug where early registration of a test observer prevented
+	// default XCTest test observer from being registered. That caused no logs being printed
+	// onto console, which in result broke several tools that relied on this.
+	// In order to go around the issue we're deferring registration to allow default
+	// test observer to register first.
+	dispatch_async(dispatch_get_main_queue(), ^{
+		[[NSUserDefaults standardUserDefaults] setValue:@"XCTestLog,GcovTestObserver"
+												 forKey:@"XCTestObserverClass"];
+	});
 }
 
 - (void)applicationWillTerminate:(UIApplication *)application {