Commit 05af1400 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Fix tests being skipped due to executables not found after ECM min bump

ECM, when requiring ECM >=5.38, sets CMAKE_*_OUTPUT_DIRECTORY, so the
tests executables are no longer generated in the current binary dir.

Calling add_test() with the signature
    add_test(<name> <command> [...])
will not result in any further processing of the <command> argument,
it will be executed as is. Using instead
    add_test(NAME <name> COMMAND <command> [...])
will result in <command> getting some handling, cmp. CMake docs:
"If <command> specifies an executable target (created by add_executable())
it will automatically be replaced by the location of the executable
created at build time."
Which is what is needed now here (and also used in ecm_add_test).
parent f86a2ed5
......@@ -2,5 +2,5 @@ add_executable(testdesktop kio_desktop_test.cpp)
target_link_libraries(testdesktop KF5::KIOWidgets KF5::Solid Qt5::Test Qt5::DBus)
ecm_mark_as_test(testdesktop)
add_test(testdesktop testdesktop)
add_test(NAME testdesktop COMMAND testdesktop)
......@@ -22,7 +22,7 @@ target_link_libraries(testHistory
Qt5::Widgets # QAction
KF5::CoreAddons # KUrlMimeData
)
add_test(klipper-testHistory testHistory)
add_test(NAME klipper-testHistory COMMAND testHistory)
ecm_mark_as_test(testHistory)
########################################################
......@@ -44,5 +44,5 @@ target_link_libraries(testHistoryModel
Qt5::Widgets # QAction
KF5::CoreAddons # KUrlMimeData
)
add_test(klipper-testHistoryModel testHistoryModel)
add_test(NAME klipper-testHistoryModel COMMAND testHistoryModel)
ecm_mark_as_test(testHistoryModel)
......@@ -13,7 +13,7 @@ set( testChromeBookmarks_SRCS testchromebookmarks.cpp
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/.. )
add_executable( testChromeBookmarks ${testChromeBookmarks_SRCS} )
#add_executable( testChromeBookmarksNAME plasma-runner-bookmarks-TestChromeBookmarks ${testChromeBookmarks_SRCS} )
add_test(testChromeBookmarks testChromeBookmarks)
add_test(NAME testChromeBookmarks COMMAND testChromeBookmarks)
ecm_mark_as_test(testChromeBookmarks)
#add_test( testChromeBookmarks TESTNAME plasma-runner-bookmarks-TestChromeBookmarks ${testChromeBookmarks_SRCS} )
target_link_libraries( testChromeBookmarks
......@@ -24,7 +24,7 @@ target_link_libraries( testChromeBookmarks
KF5::KIOCore
)
add_test(plasma-runner-bookmarks-TestChromeBookmarks testChromeBookmarks)
add_test(NAME plasma-runner-bookmarks-TestChromeBookmarks COMMAND testChromeBookmarks)
ecm_mark_as_test(testChromeBookmarks)
file(COPY chrome-config-home DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
......@@ -17,7 +17,7 @@ MACRO(PLASMASHELL_UNIT_TESTS)
if(QT_QTOPENGL_FOUND)
target_link_libraries(${_testname} Qt5::OpenGL)
endif()
add_test(${_testname} ${_testname})
add_test(NAME ${_testname} COMMAND ${_testname})
ecm_mark_as_test(${_testname})
ENDFOREACH(_testname)
ENDMACRO(PLASMASHELL_UNIT_TESTS)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment