2017-03-22 16:59:02 +00:00
|
|
|
enable_testing()
|
2017-02-22 14:34:36 +00:00
|
|
|
|
2018-06-08 16:18:07 +00:00
|
|
|
# Run tests with "ninja check" or "make check"
|
2017-02-22 14:34:36 +00:00
|
|
|
if (TARGET check)
|
2017-04-01 07:20:54 +00:00
|
|
|
message (STATUS "Target check already exists")
|
2017-02-22 14:34:36 +00:00
|
|
|
else ()
|
2017-04-01 07:20:54 +00:00
|
|
|
include (${ClickHouse_SOURCE_DIR}/cmake/add_check.cmake)
|
2017-02-22 14:34:36 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-01-26 09:03:38 +00:00
|
|
|
install (PROGRAMS clickhouse-test clickhouse-test-server DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
|
2017-12-27 19:01:57 +00:00
|
|
|
install (
|
2019-06-05 19:22:36 +00:00
|
|
|
DIRECTORY queries performance config
|
2017-12-27 19:01:57 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/clickhouse-test
|
|
|
|
USE_SOURCE_PERMISSIONS
|
|
|
|
COMPONENT clickhouse
|
|
|
|
PATTERN "CMakeLists.txt" EXCLUDE
|
|
|
|
PATTERN ".gitignore" EXCLUDE
|
|
|
|
)
|
|
|
|
|
2018-01-26 09:03:38 +00:00
|
|
|
install (FILES server-test.xml DESTINATION ${CLICKHOUSE_ETC_DIR}/clickhouse-server COMPONENT clickhouse)
|
|
|
|
install (FILES client-test.xml DESTINATION ${CLICKHOUSE_ETC_DIR}/clickhouse-client COMPONENT clickhouse)
|
|
|
|
|
2018-01-18 20:33:16 +00:00
|
|
|
if (ENABLE_TESTS)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR})
|
|
|
|
|
|
|
|
# maybe add --no-long ?
|
2018-06-04 20:26:17 +00:00
|
|
|
# if you want disable some tests: env TEST_OPT0='--skip compile'
|
2019-04-16 14:13:13 +00:00
|
|
|
if(TEST_CMAKE_PARALLEL)
|
|
|
|
# NUMBER_OF_LOGICAL_CORES
|
|
|
|
if (TEST_CMAKE_PARALLEL GREATER 1)
|
|
|
|
set(TOTAL_TESTS ${TEST_CMAKE_PARALLEL})
|
|
|
|
else()
|
|
|
|
set(TOTAL_TESTS ${NUMBER_OF_LOGICAL_CORES})
|
|
|
|
endif()
|
|
|
|
foreach(proc RANGE 1 ${TOTAL_TESTS})
|
|
|
|
add_test(NAME with_server${proc} COMMAND bash -c "env BUILD_DIR=${ClickHouse_BINARY_DIR} TEST_OPT0=--parallel=${proc}/${TOTAL_TESTS} ${CMAKE_CURRENT_SOURCE_DIR}/clickhouse-test-server")
|
|
|
|
endforeach()
|
|
|
|
else()
|
|
|
|
add_test(NAME with_server COMMAND bash -c "env BUILD_DIR=${ClickHouse_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/clickhouse-test-server")
|
|
|
|
endif()
|
|
|
|
|
2018-01-18 20:33:16 +00:00
|
|
|
endif ()
|
2018-09-21 10:46:58 +00:00
|
|
|
|
|
|
|
if (ENABLE_TEST_INTEGRATION)
|
|
|
|
add_subdirectory (integration)
|
|
|
|
endif ()
|