From 7a2bfe32f88fee8d6a29f9e26e1f7a293aaee810 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 26 Aug 2016 16:03:09 +0300 Subject: [PATCH] [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. --- cmake/test.cmake | 6 ++++++ test/src/mbgl/test/util.hpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/cmake/test.cmake b/cmake/test.cmake index 2a83a633c..c4d9dd9fa 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 15c6bfc61..ce0069131 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 #include