2017-12-14 17:10:33 +03:00
|
|
|
find_package(Qt5 COMPONENTS Core Test Xml Network REQUIRED)
|
|
|
|
|
2014-07-07 18:30:32 +04:00
|
|
|
macro(owncloud_add_test test_class additional_cpp)
|
|
|
|
set(CMAKE_AUTOMOC TRUE)
|
2016-03-30 18:58:15 +03:00
|
|
|
set(OWNCLOUD_TEST_CLASS ${test_class})
|
2012-10-26 22:24:12 +04:00
|
|
|
string(TOLOWER "${OWNCLOUD_TEST_CLASS}" OWNCLOUD_TEST_CLASS_LOWERCASE)
|
|
|
|
|
2014-07-07 18:30:32 +04:00
|
|
|
add_executable(${OWNCLOUD_TEST_CLASS}Test test${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${additional_cpp})
|
2017-02-07 21:31:55 +03:00
|
|
|
set_target_properties(${OWNCLOUD_TEST_CLASS}Test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY})
|
2012-10-26 22:24:12 +04:00
|
|
|
|
|
|
|
target_link_libraries(${OWNCLOUD_TEST_CLASS}Test
|
2014-01-29 13:38:12 +04:00
|
|
|
updater
|
2013-08-23 12:16:54 +04:00
|
|
|
${APPLICATION_EXECUTABLE}sync
|
2017-12-14 17:10:33 +03:00
|
|
|
Qt5::Core Qt5::Test Qt5::Xml Qt5::Network
|
2012-10-26 22:24:12 +04:00
|
|
|
)
|
|
|
|
|
2015-10-02 10:40:44 +03:00
|
|
|
add_definitions(-DOWNCLOUD_TEST)
|
2017-07-06 09:41:02 +03:00
|
|
|
add_definitions(-DOWNCLOUD_BIN_PATH="${CMAKE_BINARY_DIR}/bin")
|
2013-08-09 16:38:43 +04:00
|
|
|
add_test(NAME ${OWNCLOUD_TEST_CLASS}Test COMMAND ${OWNCLOUD_TEST_CLASS}Test)
|
2013-08-09 14:56:43 +04:00
|
|
|
endmacro()
|
2017-01-16 19:13:52 +03:00
|
|
|
|
|
|
|
macro(owncloud_add_benchmark test_class additional_cpp)
|
|
|
|
set(CMAKE_AUTOMOC TRUE)
|
|
|
|
set(OWNCLOUD_TEST_CLASS ${test_class})
|
|
|
|
string(TOLOWER "${OWNCLOUD_TEST_CLASS}" OWNCLOUD_TEST_CLASS_LOWERCASE)
|
|
|
|
|
|
|
|
add_executable(${OWNCLOUD_TEST_CLASS}Bench benchmarks/bench${OWNCLOUD_TEST_CLASS_LOWERCASE}.cpp ${additional_cpp})
|
2017-02-07 21:31:55 +03:00
|
|
|
set_target_properties(${OWNCLOUD_TEST_CLASS}Bench PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY})
|
2017-01-16 19:13:52 +03:00
|
|
|
|
|
|
|
target_link_libraries(${OWNCLOUD_TEST_CLASS}Bench
|
|
|
|
updater
|
|
|
|
${APPLICATION_EXECUTABLE}sync
|
2017-12-14 17:10:33 +03:00
|
|
|
Qt5::Core Qt5::Test Qt5::Xml Qt5::Network
|
2017-01-16 19:13:52 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
add_definitions(-DOWNCLOUD_TEST)
|
2017-07-06 09:41:02 +03:00
|
|
|
add_definitions(-DOWNCLOUD_BIN_PATH="${CMAKE_BINARY_DIR}/bin")
|
2017-01-16 19:13:52 +03:00
|
|
|
endmacro()
|