From 306cbb82ecf0d7c1ba4fb0a1240175b1976bd25b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 18 Jun 2014 22:49:17 +1000 Subject: GTest unit testing framework Currently covers only small set of functionality. --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 559382080f3..7e21f977302 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,7 @@ enable_testing() set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE) +set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests CACHE INTERNAL "" FORCE) #----------------------------------------------------------------------------- # Set default config options @@ -300,6 +301,9 @@ if(CMAKE_COMPILER_IS_GNUCC) mark_as_advanced(WITH_GCC_MUDFLAP) endif() +# Unit testsing +option(WITH_GTESTS "Enable GTest unit testing" OFF) + if(APPLE) cmake_minimum_required(VERSION 2.8.8) cmake_policy(VERSION 2.8.8) @@ -2330,10 +2334,17 @@ endif() #----------------------------------------------------------------------------- # Libraries +if(WITH_TESTS) + include(GTestTesting) +endif() + if(WITH_BLENDER OR WITH_PLAYER) - add_subdirectory(source) add_subdirectory(intern) add_subdirectory(extern) + + # source after intern and extern to gather all + # internal and external library information first, for test linking + add_subdirectory(source) elseif(WITH_CYCLES_STANDALONE) add_subdirectory(intern/cycles) if(NOT WITH_SYSTEM_GLEW) -- cgit v1.2.3