2014-07-07 18:30:32 +04:00
|
|
|
macro(owncloud_add_test test_class additional_cpp)
|
2014-08-27 11:15:31 +04:00
|
|
|
include_directories(${QT_INCLUDES}
|
|
|
|
"${PROJECT_SOURCE_DIR}/src/gui"
|
|
|
|
"${PROJECT_SOURCE_DIR}/src/libsync"
|
|
|
|
"${CMAKE_BINARY_DIR}/src/libsync"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
|
|
|
)
|
2012-10-26 22:24:12 +04:00
|
|
|
|
2014-07-07 18:30:32 +04:00
|
|
|
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})
|
2015-07-27 12:04:49 +03:00
|
|
|
qt5_use_modules(${OWNCLOUD_TEST_CLASS}Test Test Sql Xml Network Gui Widgets)
|
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
|
2012-10-26 22:24:12 +04:00
|
|
|
${QT_QTTEST_LIBRARY}
|
|
|
|
${QT_QTCORE_LIBRARY}
|
|
|
|
)
|
|
|
|
|
2015-10-02 10:40:44 +03:00
|
|
|
add_definitions(-DOWNCLOUD_TEST)
|
2015-10-13 16:01:59 +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()
|