Commit 58b26400 authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

cmake: run tests even without built-in gtest support

Summary:
When `gtest_add_tests()` is not available (CMake versions before 3.9) just use
`add_test()` to add each test executable as a single test.

Reviewed By: yfeldblum

Differential Revision: D6805681

fbshipit-source-id: a5fa95600dc29659498725cdc3cb1ae00188e1a3
parent 44634d57
......@@ -259,10 +259,19 @@ function(folly_define_tests)
${test_${cur_test}_sources}
)
if (HAVE_CMAKE_GTEST)
# If we have CMake's built-in gtest support use it to add each test
# function as a separate test.
gtest_add_tests(TARGET ${cur_test_name}
TEST_PREFIX "${cur_test_name}."
TEST_LIST test_cases)
set_tests_properties(${test_cases} PROPERTIES TIMEOUT 120)
else()
# Otherwise add each test executable as a single test.
add_test(
NAME ${cur_test_name}
COMMAND ${cur_test_name}
)
set_tests_properties(${cur_test_name} 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment