${test_${cur_test}_headers}
${test_${cur_test}_sources}
)
+ if (HAVE_CMAKE_GTEST)
+ gtest_add_tests(TARGET ${cur_test_name}
+ TEST_PREFIX "${cur_test_name}."
+ TEST_LIST test_cases)
+ set_tests_properties(${test_cases} PROPERTIES TIMEOUT 120)
+ endif()
if (NOT "x${test_${cur_test}_content_dir}" STREQUAL "x")
# Copy the content directory to the output directory tree so that
# tests can be run easily from Visual Studio without having to change
option(BUILD_SLOW_TESTS "If enabled, compile tests that take a while to run in debug mode." OFF)
if (BUILD_TESTS)
find_package(GMock MODULE REQUIRED)
+ include(GoogleTest OPTIONAL RESULT_VARIABLE HAVE_CMAKE_GTEST)
+ enable_testing()
add_library(folly_test_support
+ ${FOLLY_DIR}/test/common/TestMain.cpp
${FOLLY_DIR}/test/DeterministicSchedule.cpp
${FOLLY_DIR}/test/DeterministicSchedule.h
${FOLLY_DIR}/test/SingletonTestStructs.cpp
TEST access_test SOURCES AccessTest.cpp
TEST array_test SOURCES ArrayTest.cpp
TEST bit_iterator_test SOURCES BitIteratorTest.cpp
- TEST enumerate_test SOURCES EnumerateTest.cpp
+ # TODO: CMake's gtest_add_tests() function currently chokes on
+ # EnumerateTest.cpp since it uses macros to define tests.
+ #TEST enumerate_test SOURCES EnumerateTest.cpp
TEST evicting_cache_map_test SOURCES EvictingCacheMapTest.cpp
TEST foreach_test SOURCES ForeachTest.cpp
TEST merge_test SOURCES MergeTest.cpp