summaryrefslogtreecommitdiff
path: root/test/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-02-18 13:26:44 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-03-22 11:56:01 -0700
commitc587eefbb1290cc01e3e14a0ae18a2d316a498fd (patch)
tree85f3ba7e5997fa1d9d1a0305ce563741cb772d5d /test/include
parentdb5ac4785fdc02b4e233201bb3c6f55270e3c65d (diff)
downloadqtlocation-mapboxgl-c587eefbb1290cc01e3e14a0ae18a2d316a498fd.tar.gz
[ios] make unit tests work on iOS and iOS Simulator
Diffstat (limited to 'test/include')
-rw-r--r--test/include/mbgl/test/util.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/include/mbgl/test/util.hpp b/test/include/mbgl/test/util.hpp
index 911f2073b5..f778679cb8 100644
--- a/test/include/mbgl/test/util.hpp
+++ b/test/include/mbgl/test/util.hpp
@@ -1,6 +1,42 @@
#ifndef MBGL_TEST_UTIL
#define MBGL_TEST_UTIL
+#ifdef __APPLE__
+#include <TargetConditionals.h>
+#endif
+
+#if TARGET_OS_IOS
+#define TEST_READ_ONLY 1
+#define TEST_HAS_SERVER 0
+#else
+#define TEST_READ_ONLY 0
+#define TEST_HAS_SERVER 1
+#endif
+
+#if TARGET_OS_SIMULATOR
+#define TEST_IS_SIMULATOR 1
+#else
+#define TEST_IS_SIMULATOR 0
+#endif
+
+#if !TEST_IS_SIMULATOR
+#define TEST_REQUIRES_ACCURATE_TIMING(name) name
+#else
+#define TEST_REQUIRES_ACCURATE_TIMING(name) DISABLED_ ## name
+#endif
+
+#if !TEST_READ_ONLY
+#define TEST_REQUIRES_WRITE(name) name
+#else
+#define TEST_REQUIRES_WRITE(name) DISABLED_ ## name
+#endif
+
+#if TEST_HAS_SERVER
+#define TEST_REQUIRES_SERVER(name) name
+#else
+#define TEST_REQUIRES_SERVER(name) DISABLED_ ## name
+#endif
+
#include <mbgl/util/image.hpp>
#include <mbgl/util/chrono.hpp>