GTests: do not add 'performance' tests to auto-ran tests (with ctest or 'make test...
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 29 Jun 2015 16:15:02 +0000 (18:15 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 29 Jun 2015 16:15:02 +0000 (18:15 +0200)
build_files/cmake/Modules/GTestTesting.cmake
tests/gtests/blenlib/CMakeLists.txt

index 6a9cae22f332ea5d577955242080be5edc00e33a..b98d15ecd41a5aa345af4d87a4ebd348b925f798 100644 (file)
@@ -12,7 +12,7 @@
 #
 #=============================================================================
 
-macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
+macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
        if(WITH_GTESTS)
                get_property(_current_include_directories
                             DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@@ -40,10 +40,20 @@ macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
                                      RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"
                                      RUNTIME_OUTPUT_DIRECTORY_DEBUG   "${TESTS_OUTPUT_DIR}"
                                      INCLUDE_DIRECTORIES              "${TEST_INC}")
-               add_test(${NAME}_test ${TESTS_OUTPUT_DIR}/${NAME}_test)
+               if(${DO_ADD_TEST})
+                       add_test(${NAME}_test ${TESTS_OUTPUT_DIR}/${NAME}_test)
+               endif()
        endif()
 endmacro()
 
+macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
+       BLENDER_SRC_GTEST_EX("${NAME}" "${SRC}" "${EXTRA_LIBS}" "TRUE")
+endmacro()
+
 macro(BLENDER_TEST NAME EXTRA_LIBS)
-       BLENDER_SRC_GTEST("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}")
+       BLENDER_SRC_GTEST_EX("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}" "TRUE")
+endmacro()
+
+macro(BLENDER_TEST_PERFORMANCE NAME EXTRA_LIBS)
+       BLENDER_SRC_GTEST_EX("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}" "FALSE")
 endmacro()
index 20b876053d9483d44b40df6d3c12d5c4172d1534..ae773a05e8d6503c5cced27804e3dd5ab9293175 100644 (file)
@@ -46,5 +46,5 @@ BLENDER_TEST(BLI_hash_mm2a "bf_blenlib")
 BLENDER_TEST(BLI_ghash "bf_blenlib")
 
 if(WITH_TESTS_PERFORMANCE)
-       BLENDER_TEST(BLI_ghash_performance "bf_blenlib")
+       BLENDER_TEST_PERFORMANCE(BLI_ghash_performance "bf_blenlib")
 endif()