Commit 50f439af authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

cmake: run all tests from the root of the repository

Summary:
Update the CMake build process to always invoke test programs from the root of
the repository.  This makes the CMake build consistent with how we run tests
internally at Facebook.

Reviewed By: yfeldblum

Differential Revision: D6880257

fbshipit-source-id: 4c27cc643faa21d9c26faf8c77f6700ec5fe6393
parent 49cf5372
......@@ -262,6 +262,7 @@ function(folly_define_tests)
# 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}
WORKING_DIRECTORY "${TOP_DIR}"
TEST_PREFIX "${cur_test_name}."
TEST_LIST test_cases)
set_tests_properties(${test_cases} PROPERTIES TIMEOUT 120)
......@@ -270,6 +271,7 @@ function(folly_define_tests)
add_test(
NAME ${cur_test_name}
COMMAND ${cur_test_name}
WORKING_DIRECTORY "${TOP_DIR}"
)
set_tests_properties(${cur_test_name} PROPERTIES TIMEOUT 120)
endif()
......
......@@ -56,6 +56,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()
set(FOLLY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/folly")
set(TOP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
include(folly-deps) # Find the required packages
......
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