diff options
author | Julian Rex <julian.rex@mapbox.com> | 2018-05-01 07:52:42 -0400 |
---|---|---|
committer | Julian Rex <julian.rex@mapbox.com> | 2018-05-17 17:01:13 -0400 |
commit | e216ca90326b7d39d8fc909c72f8b1043f5da169 (patch) | |
tree | bf8d64391e23aa66dde701d2e4f75a1c408dae4e /platform/ios/test/MGLTestUtility.h | |
parent | 1aa5c67837a19d5f8ba8f7336f183da83e68441c (diff) | |
download | qtlocation-mapboxgl-e216ca90326b7d39d8fc909c72f8b1043f5da169.tar.gz |
Added some basic macros to handle pending tests.
Diffstat (limited to 'platform/ios/test/MGLTestUtility.h')
-rw-r--r-- | platform/ios/test/MGLTestUtility.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/platform/ios/test/MGLTestUtility.h b/platform/ios/test/MGLTestUtility.h new file mode 100644 index 0000000000..9cd5227ac5 --- /dev/null +++ b/platform/ios/test/MGLTestUtility.h @@ -0,0 +1,22 @@ +#define MGL_CHECK_PENDING_TEST() \ + /* By default, skip pending tests. Otherwise check environment for MAPBOX_RUN_PENDING_TESTS */ \ + { \ + NSString *runPendingTests = [[NSProcessInfo processInfo] environment][@"MAPBOX_RUN_PENDING_TESTS"]; \ + if (![runPendingTests boolValue]) { \ + /* The following warning will be picked up by xcpretty */ \ + printf("warning: '%s' is a pending test - skipping\n", __PRETTY_FUNCTION__); \ + 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 { + + |