From af471f7e1d7ae00122142d8f8e572543e160fc75 Mon Sep 17 00:00:00 2001 From: Julian Rex Date: Tue, 25 Sep 2018 10:20:20 -0400 Subject: Move pending test check into `invokeTest` --- .../ios/Integration Tests/MGLCameraTransitionTests.mm | 3 --- .../ios/Integration Tests/MGLMapViewIntegrationTest.m | 15 +++++++++++++++ .../Snapshotter Tests/MGLMapSnapshotterTest.m | 2 +- platform/ios/ios.xcodeproj/project.pbxproj | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/platform/ios/Integration Tests/MGLCameraTransitionTests.mm b/platform/ios/Integration Tests/MGLCameraTransitionTests.mm index f29fa5e64c..32acf6a1fe 100644 --- a/platform/ios/Integration Tests/MGLCameraTransitionTests.mm +++ b/platform/ios/Integration Tests/MGLCameraTransitionTests.mm @@ -334,8 +334,6 @@ #pragma mark - Pending tests - (void)testContinuallyResettingNorthInIsChangingPENDING { - MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN(); - // See https://github.com/mapbox/mapbox-gl-native/pull/11614 // This test currently fails, unsurprisingly, since we're continually // setting the camera to the same parameters during its update. @@ -369,7 +367,6 @@ - (void)testContinuallySettingCoordinateInIsChangingPENDING { // See above comment in `-testContinuallyResettingNorthInIsChangingPENDING` - MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN(); // Reset to non-zero, prior to testing [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(0.0, 0.0) animated:NO]; diff --git a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m index 8235945676..c427a7842f 100644 --- a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m +++ b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m @@ -6,6 +6,21 @@ @implementation MGLMapViewIntegrationTest +- (void)invokeTest { + NSString *selector = NSStringFromSelector(self.invocation.selector); + BOOL isPendingTest = [selector hasSuffix:@"PENDING"]; + + if (isPendingTest) { + NSString *runPendingTests = [[NSProcessInfo processInfo] environment][@"MAPBOX_RUN_PENDING_TESTS"]; + if (![runPendingTests boolValue]) { + printf("warning: '%s' is a pending test - skipping\n", selector.UTF8String); + return; + } + } + + [super invokeTest]; +} + - (NSString*)validAccessToken { NSString *accessToken = [[NSProcessInfo processInfo] environment][@"MAPBOX_ACCESS_TOKEN"]; if (!accessToken) { diff --git a/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m b/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m index fd5b3db978..ca7462f160 100644 --- a/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m +++ b/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m @@ -282,7 +282,7 @@ MGLMapSnapshotter* snapshotterWithCoordinates(CLLocationCoordinate2D coordinates } - (void)testMultipleSnapshottersPENDING { - MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN(); + if (![self validAccessToken]) { return; } diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 7d448a5d91..0951a94218 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -1027,7 +1027,7 @@ ACA65F552140696B00537748 /* MMEDispatchManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MMEDispatchManager.h; path = "vendor/mapbox-events-ios/MapboxMobileEvents/MMEDispatchManager.h"; sourceTree = SOURCE_ROOT; }; ACA65F562140697100537748 /* MMEDispatchManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMEDispatchManager.m; path = "vendor/mapbox-events-ios/MapboxMobileEvents/MMEDispatchManager.m"; sourceTree = SOURCE_ROOT; }; CA0C27912076C804001CE5B7 /* MGLShapeSourceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLShapeSourceTests.m; sourceTree = ""; }; - CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapViewIntegrationTest.m; sourceTree = ""; }; + CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapViewIntegrationTest.m; sourceTree = ""; wrapsLines = 0; }; CA0C27952076CA50001CE5B7 /* MGLMapViewIntegrationTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLMapViewIntegrationTest.h; sourceTree = ""; }; CA1B4A502099FB2200EDD491 /* MGLMapSnapshotterTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapSnapshotterTest.m; sourceTree = ""; }; CA34C9C2207FD272005C1A06 /* MGLCameraTransitionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLCameraTransitionTests.mm; sourceTree = ""; }; -- cgit v1.2.1