Commit 3ac0ff65 authored by Andreas Sturmlechner's avatar Andreas Sturmlechner
Browse files

Use ecm_add_test and benefit from BUILD_TESTING awareness

Test Plan: Tests continue to work fine.

Reviewers: #keditbookmarks, dfaure

Reviewed By: #keditbookmarks, dfaure

Differential Revision: https://phabricator.kde.org/D7221
parent e58b84fa
......@@ -29,6 +29,10 @@ set(KEDITBOOKMARKS_VERSION "5.97.0")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n KIO Bookmarks Parts WindowSystem IconThemes DocTools)
if(BUILD_TESTING)
find_package(Qt5Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
endif()
add_definitions(-DQT_USE_FAST_CONCATENATION)
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
......
add_subdirectory(tests)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
set(kbookmarkmodel_SRCS
commandhistory.cpp
......
include(ECMAddTests)
set(QT_REQUIRED_VERSION "5.2.0")
find_package(Qt5Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
###### kbookmarkmodeltest ######
set(kbookmarkmodeltest_SRCS kbookmarkmodeltest.cpp)
add_executable(kbookmarkmodeltest ${kbookmarkmodeltest_SRCS})
add_test(kbookmarkmodeltest kbookmarkmodeltest)
ecm_mark_as_test(kbookmarkmodeltest)
target_link_libraries(kbookmarkmodeltest kbookmarkmodel_private
KF5::Bookmarks
Qt5::Test
ecm_add_test(${kbookmarkmodeltest_SRCS}
TEST_NAME kbookmarkmodeltest
LINK_LIBRARIES kbookmarkmodel_private KF5::Bookmarks Qt5::Test
)
Markdown is supported
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