summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-08-26 16:03:09 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-08-26 16:08:44 +0300
commit7a2bfe32f88fee8d6a29f9e26e1f7a293aaee810 (patch)
tree3a46da1a8c726a00a2afbd1264c5a79c294f171c
parent9605cac3e979f73f7d09d580cbf1087e251f1b49 (diff)
downloadqtlocation-mapboxgl-7a2bfe32f88fee8d6a29f9e26e1f7a293aaee810.tar.gz
[tests] Make it possible to disable tests on the CI
Useful for tests that depend on a good network connection and you want to run manually.
-rw-r--r--cmake/test.cmake6
-rw-r--r--test/src/mbgl/test/util.hpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/cmake/test.cmake b/cmake/test.cmake
index 2a83a633c0..c4d9dd9fad 100644
--- a/cmake/test.cmake
+++ b/cmake/test.cmake
@@ -16,6 +16,12 @@ target_include_directories(mbgl-test
PRIVATE platform/default
)
+if(DEFINED ENV{CI})
+ target_compile_definitions(mbgl-test
+ PRIVATE -DCI_BUILD=1
+ )
+endif()
+
target_link_libraries(mbgl-test
PRIVATE mbgl-core
)
diff --git a/test/src/mbgl/test/util.hpp b/test/src/mbgl/test/util.hpp
index 15c6bfc61a..ce0069131c 100644
--- a/test/src/mbgl/test/util.hpp
+++ b/test/src/mbgl/test/util.hpp
@@ -36,6 +36,12 @@
#define TEST_REQUIRES_SERVER(name) DISABLED_ ## name
#endif
+#if !CI_BUILD
+#define TEST_DISABLED_ON_CI(name) name
+#else
+#define TEST_DISABLED_ON_CI(name) DISABLED_ ## name
+#endif
+
#include <mbgl/util/image.hpp>
#include <mbgl/util/chrono.hpp>