2016-06-05 20:30:40 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2016-05-16 04:43:42 +08:00
|
|
|
|
2016-12-16 21:05:04 +08:00
|
|
|
project(${project_name}_tests)
|
2016-05-16 04:43:42 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
include_directories(${catch_source_dir}/include)
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-12-23 16:58:26 +08:00
|
|
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/test_results/unit)
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/test_results/benchmark)
|
2016-12-22 22:51:16 +08:00
|
|
|
|
2016-12-18 17:16:07 +08:00
|
|
|
# copy test data
|
2016-06-07 05:57:16 +08:00
|
|
|
file(COPY ${CMAKE_SOURCE_DIR}/tests/data
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/tests)
|
2016-12-18 17:16:07 +08:00
|
|
|
|
|
|
|
# move test data data to the build directory
|
|
|
|
if (UNIX)
|
|
|
|
set(test_data "tests/data")
|
|
|
|
set(test_data_src "${CMAKE_SOURCE_DIR}/${test_data}")
|
|
|
|
set(test_data_dst "${CMAKE_BINARY_DIR}/${test_data}")
|
|
|
|
add_custom_target (test_data
|
|
|
|
COMMAND rm -rf ${test_data_dst}
|
|
|
|
COMMAND cp -r ${test_data_src} ${test_data_dst}
|
|
|
|
)
|
|
|
|
endif (UNIX)
|
|
|
|
# -----------------------------------------------------------------------------
|
2016-12-18 04:00:32 +08:00
|
|
|
|
|
|
|
# benchmark test binaries
|
|
|
|
if (ALL_TESTS OR BENCHMARK_TESTS)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/benchmark)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# concurrent test binaries
|
|
|
|
if (ALL_TESTS OR CONCURRENT_TESTS)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/concurrent)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# integration test binaries
|
|
|
|
if (ALL_TESTS OR INTEGRATION_TESTS)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/integration)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# manual test binaries
|
|
|
|
if (ALL_TESTS OR MANUAL_TESTS)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/manual)
|
|
|
|
endif()
|
2016-05-23 13:51:36 +08:00
|
|
|
|
2016-12-18 04:00:32 +08:00
|
|
|
# unit test binaries
|
|
|
|
if (ALL_TESTS OR UNIT_TESTS)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/unit)
|
|
|
|
endif()
|