diff options
author | Alexander Golubev <[email protected]> | 2016-06-28 06:14:50 +0300 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2017-01-29 02:48:48 +0100 |
commit | 73da3d8e5cd6a22dd83a8c1cb51db5b0328480da (patch) | |
tree | f980da2eead988179a316c04a5a316224882ac52 /dcop/tests/CMakeLists.txt | |
parent | 297691c5b8e2b616a401eec5effe4f3f291c544e (diff) | |
download | tdelibs-73da3d8e5cd6a22dd83a8c1cb51db5b0328480da.tar.gz tdelibs-73da3d8e5cd6a22dd83a8c1cb51db5b0328480da.zip |
Add dcop tests to cmake
Signed-off-by: Alexander Golubev <[email protected]>
(cherry picked from commit 26d76a4c048d99e282356616ca8e1e5ad45a7f53)
Diffstat (limited to 'dcop/tests/CMakeLists.txt')
-rw-r--r-- | dcop/tests/CMakeLists.txt | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/dcop/tests/CMakeLists.txt b/dcop/tests/CMakeLists.txt new file mode 100644 index 000000000..c7bbbcfee --- /dev/null +++ b/dcop/tests/CMakeLists.txt @@ -0,0 +1,62 @@ +################################################# +# +# (C) 2016 Alexander Golubev +# fatzer2 (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_BINARY_DIR}/tdecore +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### checks #################################### + +tde_add_check_executable( dcop_test AUTOMOC + SOURCES test.cpp ${CMAKE_CURRENT_BINARY_DIR}/test.skel ${CMAKE_CURRENT_BINARY_DIR}/test.h + LINK tdecore-shared +) + +tde_add_check_executable( driver AUTOMOC + SOURCES driver.cpp ${CMAKE_CURRENT_BINARY_DIR}/test.stub ${CMAKE_CURRENT_BINARY_DIR}/test.h + LINK tdecore-shared +) + +add_test( NAME dcop-tests COMMAND sh -x "${CMAKE_CURRENT_SOURCE_DIR}/run-tests.sh" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) + + +##### test.h and files ########################## + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test.h ${CMAKE_CURRENT_BINARY_DIR}/shell.generated + COMMAND perl "${CMAKE_CURRENT_SOURCE_DIR}/generate.pl" + <"${CMAKE_CURRENT_SOURCE_DIR}/testcases" + DEPENDS testcases generate.pl + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) + +# a hack because *.skel and *.stub files have to be located the same place with the *.h +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test.skel + COMMAND ${CMAKE_COMMAND} -E copy_file + ${CMAKE_CURRENT_SOURCE_DIR}/test.skel ${CMAKE_CURRENT_BINARY_DIR}/ +) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test.stub + COMMAND ${CMAKE_COMMAND} -E copy_file + ${CMAKE_CURRENT_SOURCE_DIR}/test.stub ${CMAKE_CURRENT_BINARY_DIR}/ +) |