diff --git a/circle.yml b/circle.yml index a7fa95c2a60..145368d3050 100644 --- a/circle.yml +++ b/circle.yml @@ -34,6 +34,7 @@ workflows: - linux-gcc4.9-debug - linux-gcc5-debug-coverage - ios-debug + - ios-debug-xcode10 - ios-release - ios-release-tag: filters: @@ -947,6 +948,39 @@ jobs: - *collect-xcode-build-logs - *upload-xcode-build-logs +# ------------------------------------------------------------------------------ + ios-debug-xcode10: + macos: + xcode: "10.0.0" + environment: + BUILDTYPE: Debug + HOMEBREW_NO_AUTO_UPDATE: 1 + steps: + - checkout + - *restore-node_modules-cache + - *npm-install + - *prepare-environment + - *install-macos-dependencies + - *prepare-ccache + - *restore-mason_packages-cache + - *restore-ccache + - *reset-ccache-stats + - *build-ios-test + - *build-ios-integration-test + - *check-public-symbols + - run: + name: Lint plist files + command: make ios-lint + - run: + name: Nitpick Darwin code generation + command: scripts/nitpick/generated-code.js darwin + - *show-ccache-stats + - *save-node_modules-cache + - *save-mason_packages-cache + - *save-ccache + - *collect-xcode-build-logs + - *upload-xcode-build-logs + # ------------------------------------------------------------------------------ ios-sanitize: macos: diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index 9edb33a0785..dd34b252914 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -34,7 +34,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 256, height: 256), styleURL: MGLDocumentationExampleTests.styleURL) mapView.delegate = self styleLoadingExpectation = expectation(description: "Map view should finish loading style") - waitForExpectations(timeout: 1, handler: nil) + waitForExpectations(timeout: 5, handler: nil) } override func tearDown() { diff --git a/platform/darwin/test/MGLDocumentationGuideTests.swift b/platform/darwin/test/MGLDocumentationGuideTests.swift index 4de1d81aa93..b7f654acebc 100644 --- a/platform/darwin/test/MGLDocumentationGuideTests.swift +++ b/platform/darwin/test/MGLDocumentationGuideTests.swift @@ -37,7 +37,7 @@ class MGLDocumentationGuideTests: XCTestCase, MGLMapViewDelegate { mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 256, height: 256), styleURL: styleURL) mapView.delegate = self styleLoadingExpectation = expectation(description: "Map view should finish loading style") - waitForExpectations(timeout: 1, handler: nil) + waitForExpectations(timeout: 5, handler: nil) } override func tearDown() { diff --git a/platform/darwin/test/MGLOfflineStorageTests.mm b/platform/darwin/test/MGLOfflineStorageTests.mm index 261e9a3a9c6..ad6e1a0570e 100644 --- a/platform/darwin/test/MGLOfflineStorageTests.mm +++ b/platform/darwin/test/MGLOfflineStorageTests.mm @@ -43,7 +43,7 @@ - (void)setUp { [expectation fulfill]; [self waitForExpectationsWithTimeout:0 handler:nil]; } else { - [self waitForExpectationsWithTimeout:2 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; } XCTAssertNotNil([MGLOfflineStorage sharedOfflineStorage].packs, @"Shared offline storage object should have a non-nil collection of packs by this point."); @@ -86,7 +86,7 @@ - (void)testAddPackForBounds { pack = completionHandlerPack; [additionCompletionHandlerExpectation fulfill]; }]; - [self waitForExpectationsWithTimeout:2 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Added pack should have been added to the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks."); @@ -124,7 +124,7 @@ - (void)testAddPackForBounds { return notificationPack == pack && pack.state == MGLOfflinePackStateInactive; }]; [pack requestProgress]; - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; } - (void)testAddPackForGeometry { @@ -157,7 +157,7 @@ - (void)testAddPackForGeometry { pack = completionHandlerPack; [additionCompletionHandlerExpectation fulfill]; }]; - [self waitForExpectationsWithTimeout:2 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Added pack should have been added to the canonical collection of packs owned by the shared offline storage object. This assertion can fail if this test is run before -testAAALoadPacks."); @@ -195,7 +195,7 @@ - (void)testAddPackForGeometry { return notificationPack == pack && pack.state == MGLOfflinePackStateInactive; }]; [pack requestProgress]; - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; pack = nil; } @@ -239,7 +239,7 @@ - (void)testRemovePack { XCTAssertEqual(pack.state, MGLOfflinePackStateInvalid, @"Removed pack should be invalid in the completion handler."); [completionHandlerExpectation fulfill]; }]; - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; XCTAssertEqual(pack.state, MGLOfflinePackStateInvalid, @"Removed pack should have been invalidated synchronously."); @@ -314,9 +314,9 @@ - (void)testAddFileContent { NSNumber *fileSizeNumber = [fileAttributes objectForKey:NSFileSize]; long long fileSize = [fileSizeNumber longLongValue]; - long long dabaseFileSize = 32391168; + long long databaseFileSize = 32391168; // Merging databases creates an empty file if the file does not exist at the given path. - XCTAssertEqual(fileSize, dabaseFileSize, @"The dabase file size must be:%lld actual size:%lld", dabaseFileSize, fileSize); + XCTAssertEqual(fileSize, databaseFileSize, @"The database file size must be:%lld actual size:%lld", databaseFileSize, fileSize); NSUInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; @@ -337,7 +337,7 @@ - (void)testAddFileContent { } [fileAdditionCompletionHandlerExpectation fulfill]; }]; - [self waitForExpectationsWithTimeout:2 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; // Depending on the database it may update or add a pack. For this case specifically the offline database adds one pack. XCTAssertEqual([MGLOfflineStorage sharedOfflineStorage].packs.count, countOfPacks + 1, @"Adding contents of barcelona.db should add one pack."); } @@ -364,7 +364,7 @@ - (void)testAddFileContent { XCTAssertNil(packs, @"Passing an invalid offline database file should not add packs to the offline database."); [invalidFileCompletionHandlerExpectation fulfill]; }]; - [self waitForExpectationsWithTimeout:2 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; } // File non existent { diff --git a/platform/darwin/test/MGLStyleLayerTests.m b/platform/darwin/test/MGLStyleLayerTests.m index 52b36dba00b..5dc97dc5817 100644 --- a/platform/darwin/test/MGLStyleLayerTests.m +++ b/platform/darwin/test/MGLStyleLayerTests.m @@ -37,6 +37,13 @@ - (void)testPropertyName:(NSString *)name isBoolean:(BOOL)isBoolean { if (isBoolean) { if ([components.firstObject isEqualToString:@"is"]) { [components removeObjectAtIndex:0]; + + // Xcode 10 incorrectly classifies "optional" as a verb, so return early to avoid the verb checks. + // https://openradar.appspot.com/44149950 + if ([components.lastObject isEqualToString:@"optional"] && NSFoundationVersionNumber >= 1548) { + return; + } + if (![components.lastObject.lexicalClasses containsObject:NSLinguisticTagAdjective]) { XCTAssertTrue([components.lastObject.lexicalClasses containsObject:NSLinguisticTagVerb], @"Boolean getter %@ that starts with “is” should contain an adjective, past participle, or verb.", name); diff --git a/platform/darwin/test/MGLStyleTests.mm b/platform/darwin/test/MGLStyleTests.mm index f2a02963fc5..ccab5961c91 100644 --- a/platform/darwin/test/MGLStyleTests.mm +++ b/platform/darwin/test/MGLStyleTests.mm @@ -33,7 +33,7 @@ - (void)setUp { self.mapView.delegate = self; if (!self.mapView.style) { _styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; } } diff --git a/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m b/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m index ebd587ebe69..ba63a9eff49 100644 --- a/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m +++ b/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m @@ -102,7 +102,7 @@ - (void)waitForCollisionDetectionToRun { [timerExpired fulfill]; }); - [self waitForExpectations:@[timerExpired, self.renderFinishedExpectation] timeout:1.0]; + [self waitForExpectations:@[timerExpired, self.renderFinishedExpectation] timeout:5]; } @end diff --git a/platform/ios/Integration Tests/MBGLIntegrationTests.m b/platform/ios/Integration Tests/MBGLIntegrationTests.m index 4f42c5a13f9..aeff0ba6f38 100644 --- a/platform/ios/Integration Tests/MBGLIntegrationTests.m +++ b/platform/ios/Integration Tests/MBGLIntegrationTests.m @@ -186,7 +186,7 @@ - (void)testOpenGLLayerDoesNotLeakWhenMapViewDeallocs { XCTAssertNil(mapView2.style); self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; weakLayer = layer; diff --git a/platform/ios/Integration Tests/MGLCameraTransitionTests.mm b/platform/ios/Integration Tests/MGLCameraTransitionTests.mm index 0b28104c961..f29fa5e64c2 100644 --- a/platform/ios/Integration Tests/MGLCameraTransitionTests.mm +++ b/platform/ios/Integration Tests/MGLCameraTransitionTests.mm @@ -34,7 +34,7 @@ - (void)testSetAndResetNorthWithDispatchAsyncInDelegateMethod { [self.mapView setDirection:90 animated:YES]; // loop, render, and wait - [self waitForExpectations:@[expectation] timeout:1.5]; + [self waitForExpectations:@[expectation] timeout:5]; } @@ -62,7 +62,7 @@ - (void)testSetAndResetNorthInDelegateMethod { }; [self.mapView setDirection:90 animated:YES]; - [self waitForExpectations:@[expectation] timeout:1.5]; + [self waitForExpectations:@[expectation] timeout:5]; } - (void)testInterruptingAndResetNorthOnlyOnceInIsChanging { @@ -106,7 +106,7 @@ - (void)testInterruptingAndResetNorthOnlyOnceInIsChanging { }; [self.mapView setDirection:90 animated:YES]; - [self waitForExpectations:@[expectation] timeout:1.5]; + [self waitForExpectations:@[expectation] timeout:5]; XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction); } @@ -222,7 +222,7 @@ - (void)testSetCenterCoordinateInDelegateMethod { // Should take MGLAnimationDuration seconds (0.3) [self.mapView setCenterCoordinate:target zoomLevel:15.0 animated:YES]; - [self waitForExpectations:@[expectation] timeout:1.5]; + [self waitForExpectations:@[expectation] timeout:5]; } - (void)testFlyToCameraInDelegateMethod { @@ -323,7 +323,7 @@ - (void)testFlyToCameraInDelegateMethod { // Should take MGLAnimationDuration [self.mapView setCenterCoordinate:target zoomLevel:zoomLevel animated:YES]; - [self waitForExpectations:@[expectation] timeout:2.0]; + [self waitForExpectations:@[expectation] timeout:5]; NSLog(@"setCenterCoordinate: %0.4fs", stop1 - stop0); NSLog(@"flyToCamera: %0.4fs", stop2 - stop1); @@ -362,7 +362,7 @@ - (void)testContinuallyResettingNorthInIsChangingPENDING { }; [self.mapView setDirection:90 animated:YES]; - [self waitForExpectations:@[expectation] timeout:1.5]; + [self waitForExpectations:@[expectation] timeout:5]; XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction); } @@ -389,7 +389,7 @@ - (void)testContinuallySettingCoordinateInIsChangingPENDING { }; [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(40.0, 40.0) animated:YES]; - [self waitForExpectations:@[expectation] timeout:1.5]; + [self waitForExpectations:@[expectation] timeout:5]; XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction); } diff --git a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m index 68023f35565..82359456769 100644 --- a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m +++ b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m @@ -33,7 +33,7 @@ - (void)setUp { [window makeKeyAndVisible]; if (!self.mapView.style) { - [self waitForMapViewToFinishLoadingStyleWithTimeout:1]; + [self waitForMapViewToFinishLoadingStyleWithTimeout:5]; } } diff --git a/platform/ios/test/MGLAnnotationViewTests.m b/platform/ios/test/MGLAnnotationViewTests.m index 7bf7c90a334..6c3cd6ea4a5 100644 --- a/platform/ios/test/MGLAnnotationViewTests.m +++ b/platform/ios/test/MGLAnnotationViewTests.m @@ -85,7 +85,7 @@ - (void)testAnnotationView MGLTestAnnotation *annotation = [[MGLTestAnnotation alloc] init]; [_mapView addAnnotation:annotation]; - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; XCTAssert(_mapView.annotations.count == 1, @"number of annotations should be 1"); XCTAssertNotNil(_annotationView.annotation, @"annotation property should not be nil"); diff --git a/platform/ios/test/MGLMapViewLayoutTests.m b/platform/ios/test/MGLMapViewLayoutTests.m index 16f6cdada3b..4bdff51e255 100644 --- a/platform/ios/test/MGLMapViewLayoutTests.m +++ b/platform/ios/test/MGLMapViewLayoutTests.m @@ -35,7 +35,7 @@ - (void)setUp { [self.superView addConstraints:[verticalConstraints arrayByAddingObjectsFromArray:horizonatalConstraints]]; self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectationsWithTimeout:5 handler:nil]; self.mapView.showsScale = YES;