diff options
author | Julian Rex <julian.rex@mapbox.com> | 2018-05-03 19:54:53 -0400 |
---|---|---|
committer | Julian Rex <julian.rex@mapbox.com> | 2018-05-17 17:01:13 -0400 |
commit | 81bd7673d2b0c95bdb8970397a3a3e1a5e734b18 (patch) | |
tree | 2a0d5ff8b8d2434a6e0b146b28379fd2e0bf73b2 | |
parent | e216ca90326b7d39d8fc909c72f8b1043f5da169 (diff) | |
download | qtlocation-mapboxgl-81bd7673d2b0c95bdb8970397a3a3e1a5e734b18.tar.gz |
Removed superfluous macros.
-rw-r--r-- | platform/ios/test/MGLAnnotationViewTests.m | 6 | ||||
-rw-r--r-- | platform/ios/test/MGLTestUtility.h | 31 |
2 files changed, 22 insertions, 15 deletions
diff --git a/platform/ios/test/MGLAnnotationViewTests.m b/platform/ios/test/MGLAnnotationViewTests.m index 1ae7538b90..7bf7c90a33 100644 --- a/platform/ios/test/MGLAnnotationViewTests.m +++ b/platform/ios/test/MGLAnnotationViewTests.m @@ -210,7 +210,8 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu XCTAssertEqual(view.dragState, MGLAnnotationViewDragStateNone); } -MGL_PENDING_TEST(testAnnotationViewInitWithFrame) +- (void)testAnnotationViewInitWithFramePENDING { + MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN(); CGRect frame = CGRectMake(10.0, 10.0, 100.0, 100.0); MGLAnnotationView *view = [[MGLAnnotationView alloc] initWithFrame:frame]; [self checkDefaultPropertiesForAnnotationView:view]; @@ -221,7 +222,8 @@ MGL_PENDING_TEST(testAnnotationViewInitWithFrame) [self checkDefaultPropertiesForAnnotationView:view]; } -MGL_PENDING_TEST(testSelectingADisabledAnnotationView) +- (void)testSelectingADisabledAnnotationViewPENDING { + MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN(); self.prepareAnnotationView = ^(MGLAnnotationView *view) { view.enabled = NO; }; diff --git a/platform/ios/test/MGLTestUtility.h b/platform/ios/test/MGLTestUtility.h index 9cd5227ac5..2e02e4f9de 100644 --- a/platform/ios/test/MGLTestUtility.h +++ b/platform/ios/test/MGLTestUtility.h @@ -1,4 +1,21 @@ -#define MGL_CHECK_PENDING_TEST() \ + +/** + MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN() + + Include this macro at the top of a "pending" test - one that would normally fail, + but you want to include is as a compile-time test or as a reminder. + + This will output the included warning in the test log, which `xcpretty` will detect. + This allows such pending tests to be identified in CI logs. + + If you provide `MAPBOX_RUN_PENDING_TESTS` as an environment variable ALL pending + tests will run. + + In addition, it's a good idea to append `PENDING` to the test method name, as this + will also be picked up by xcpretty. PENDING tests will be distinguished by a `⧖` + and `[PENDING]` + */ +#define MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN() \ /* By default, skip pending tests. Otherwise check environment for MAPBOX_RUN_PENDING_TESTS */ \ { \ NSString *runPendingTests = [[NSProcessInfo processInfo] environment][@"MAPBOX_RUN_PENDING_TESTS"]; \ @@ -8,15 +25,3 @@ return; \ } \ } - -#define MGL_PENDING_TEST(name) \ - /* Appending `PENDING` to the method name allows xcpretty to mark the test as pending */ \ - - (void)name ## PENDING { MGL_CHECK_PENDING_TEST() - -#define MGL_ENABLED_TEST(name) \ - - (void)name { - -#define MGL_DISABLED_TEST(name) \ - - (void)DISABLED ## name { - - |