Files
MapLibreParticleLab/platform/darwin/test/MLNTestUtility.h
mwilsnd 20d9e1028c Platform flattening overhaul (#1393)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
2023-07-26 17:50:34 +02:00

28 lines
1.1 KiB
C

/**
MLN_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 MLN_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"]; \
if (![runPendingTests boolValue]) { \
/* The following warning will be picked up by xcpretty */ \
printf("warning: '%s' is a pending test - skipping\n", __PRETTY_FUNCTION__); \
return; \
} \
}