Commit c91441ab authored by Laurent Montel's avatar Laurent Montel 😁

Allow to run test without install it

parent b664bfaf
......@@ -4,7 +4,15 @@ set(PIM_VERSION "5.6.42")
project(libksieve VERSION ${PIM_VERSION})
set(KF5_VERSION "5.37.0")
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
option(RUN_UNINSTALL "test run uninstalled apps (experimental)" FALSE)
set(ECM_VERSION ${KF5_VERSION})
# ECM setup
if (RUN_UNINSTALL)
set(ECM_VERSION "5.38.0")
endif()
find_package(ECM ${ECM_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${libksieve_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
include(GenerateExportHeader)
......
set( libksieveui_sieveeditormenubartest_source sieveeditormenubartest.cpp ../sieveeditormenubar.cpp
)
add_executable( sieveeditormenubartest ${libksieveui_sieveeditormenubartest_source})
add_test(sieveeditormenubartest sieveeditormenubartest)
add_test(NAME sieveeditormenubartest COMMAND sieveeditormenubartest)
ecm_mark_as_test(sieveeditormenubartest)
target_link_libraries( sieveeditormenubartest KF5::KSieveUi KF5::KSieve Qt5::Test Qt5::Gui Qt5::Widgets KF5::Completion KF5::IconThemes KF5::PimCommon KF5::ConfigWidgets KF5::I18n KF5::PimTextEdit Qt5::PrintSupport Qt5::WebEngineWidgets KF5::MailTransport)
set_property(TARGET sieveeditormenubartest PROPERTY INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/ksieveui/ ${CMAKE_SOURCE_DIR}/src/ksieveui/editor/webengine/ ${CMAKE_SOURCE_DIR}/src/ksieveui/editor/webengine/findbar ${CMAKE_BINARY_DIR}/src/ksieveui/)
......@@ -10,13 +10,13 @@ set_property(TARGET sieveeditormenubartest PROPERTY INCLUDE_DIRECTORIES ${CMAKE_
set( libksieveui_sievetextedittest_source sievetextedittest.cpp )
add_executable( sievetextedittest ${libksieveui_sievetextedittest_source})
add_test(sievetextedittest sievetextedittest)
add_test(NAME sievetextedittest COMMAND sievetextedittest)
ecm_mark_as_test(sievetextedittest)
target_link_libraries( sievetextedittest Qt5::Test Qt5::Gui KF5::KSieveUi KF5::PimCommon KF5::PimTextEdit Qt5::PrintSupport)
set( libksieveui_sievetexteditwidgettest_source sievetexteditwidgettest.cpp )
add_executable( sievetexteditwidgettest ${libksieveui_sievetexteditwidgettest_source})
add_test(sievetexteditwidgettest sievetexteditwidgettest)
add_test(NAME sievetexteditwidgettest COMMAND sievetexteditwidgettest)
ecm_mark_as_test(sievetexteditwidgettest)
target_link_libraries( sievetexteditwidgettest Qt5::Test Qt5::Gui KF5::KSieveUi KF5::PimCommon KF5::PimTextEdit Qt5::PrintSupport)
......@@ -3,7 +3,7 @@ set( libksieveui_sieveeditorhelphtmlwidgettest_source sieveeditorhelphtmlwidgett
../sieveeditorloadprogressindicator.cpp
)
add_executable( sieveeditorhelphtmlwidgettest ${libksieveui_sieveeditorhelphtmlwidgettest_source})
add_test(sieveeditorhelphtmlwidgettest sieveeditorhelphtmlwidgettest)
add_test(NAME sieveeditorhelphtmlwidgettest COMMAND sieveeditorhelphtmlwidgettest)
ecm_mark_as_test(sieveeditorhelphtmlwidgettest)
target_link_libraries( sieveeditorhelphtmlwidgettest
Qt5::Test
......
......@@ -4,7 +4,7 @@ macro( add_managesievejob_test _source )
set( _test ${_source})
get_filename_component( _name ${_source} NAME_WE )
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
add_test(NAME ${_name} COMMAND ${_name})
ecm_mark_as_test(managejob-${_name})
target_link_libraries( ${_name} KF5::KSieveUi Qt5::Test )
endmacro()
......
......@@ -4,7 +4,7 @@ macro( add_sieveimapinstance_test _source _additionalsource)
set( _test ${_source} ${_additionalsource})
get_filename_component( _name ${_source} NAME_WE )
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
add_test(NAME ${_name} COMMAND ${_name})
ecm_mark_as_test(sieveimapinstancetest-${_name})
target_link_libraries( ${_name} KF5::KSieveUi Qt5::Test)
endmacro()
......
......@@ -4,7 +4,7 @@ macro( add_sievescriptdebugger_test _source )
set( _test ${_source})
get_filename_component( _name ${_source} NAME_WE )
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
add_test(NAME ${_name} COMMAND ${_name})
ecm_mark_as_test(sievescriptdebugger-${_name})
target_link_libraries( ${_name} KF5::KSieveUi Qt5::Test KF5::Completion KF5::KIOWidgets KF5::PimTextEdit)
endmacro()
......
......@@ -2,7 +2,7 @@ macro(add_sieveutil_test _source _additionalsource)
set( _test ${_source} ${_additionalsource})
get_filename_component( _name ${_source} NAME_WE )
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
add_test(NAME ${_name} COMMAND ${_name})
ecm_mark_as_test(sievescriptdebugger-${_name})
target_link_libraries( ${_name} KF5::KSieveUi Qt5::Test KF5::MailTransport KF5::I18n)
endmacro()
......
......@@ -14,7 +14,7 @@ macro( add_vacation_test _source )
get_filename_component(_name ${_source}test NAME_WE)
ecm_qt_declare_logging_category(_test HEADER libksieve_debug.h IDENTIFIER LIBKSIEVE_LOG CATEGORY_NAME org.kde.pim.libksieve)
add_executable(${_name} ${_test})
add_test(vacation-${_name} ${_name})
add_test(NAME vacation-${_name} COMMAND ${_name})
ecm_mark_as_test(vacation-${_name})
add_definitions(-DVACATIONTESTDATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data/")
target_link_libraries(${_name}
......
......@@ -2,7 +2,7 @@ macro(add_autocreatescriptswidget_test _source _additionalsource)
set( _test ${_source} ${_additionalsource})
get_filename_component( _name ${_source} NAME_WE )
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
add_test(NAME ${_name} COMMAND ${_name})
ecm_mark_as_test(sievescriptdebugger-${_name})
target_link_libraries( ${_name} KF5::KSieveUi Qt5::Test)
endmacro()
......
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