2014-04-26 17:33:58 +02:00
|
|
|
find_package(Qt5Test ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
|
|
|
|
set_package_properties(Qt5Test PROPERTIES PURPOSE "Required for tests")
|
|
|
|
|
2008-11-04 00:08:39 +01:00
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2013-06-19 02:06:55 +02:00
|
|
|
include(ECMMarkAsTest)
|
2014-07-11 22:01:56 +02:00
|
|
|
include(ECMAddTests)
|
2013-06-19 02:06:55 +02:00
|
|
|
|
2013-12-11 14:01:52 +01:00
|
|
|
find_package(KF5CoreAddons REQUIRED)
|
2014-07-14 14:22:36 +02:00
|
|
|
find_package(KF5XmlGui REQUIRED)
|
2014-07-11 22:01:56 +02:00
|
|
|
find_package(Qt5Widgets REQUIRED)
|
2013-03-05 14:43:14 +01:00
|
|
|
|
2013-06-19 02:06:55 +02:00
|
|
|
# add_definitions( -DKDESRCDIR=${CMAKE_CURRENT_SOURCE_DIR} )
|
|
|
|
|
2014-08-08 06:45:38 +02:00
|
|
|
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
|
|
|
|
set(PLASMA_NO_KIO TRUE)
|
|
|
|
set(PLASMA_NO_PACKAGEKIT TRUE)
|
|
|
|
set(PLASMA_NO_PACKAGE_EXTRADATA TRUE)
|
|
|
|
endif()
|
|
|
|
|
2008-11-04 00:08:39 +01:00
|
|
|
MACRO(PLASMA_UNIT_TESTS)
|
|
|
|
FOREACH(_testname ${ARGN})
|
2017-06-06 14:45:10 +02:00
|
|
|
set(libs Qt5::Qml Qt5::Test KF5::Plasma KF5::PlasmaQuick
|
|
|
|
KF5::Archive KF5::CoreAddons KF5::ConfigGui KF5::I18n
|
|
|
|
KF5::KIOCore KF5::Service KF5::IconThemes
|
2017-07-03 23:18:01 +02:00
|
|
|
KF5::Declarative KF5::WindowSystem)
|
2011-03-25 16:33:11 +01:00
|
|
|
if(QT_QTOPENGL_FOUND)
|
2017-06-06 14:45:10 +02:00
|
|
|
list(APPEND libs Qt5::OpenGL)
|
2013-11-14 17:25:10 +01:00
|
|
|
endif()
|
2017-06-06 14:45:10 +02:00
|
|
|
ecm_add_test(${_testname}.cpp
|
|
|
|
LINK_LIBRARIES ${libs}
|
|
|
|
NAME_PREFIX "plasma-")
|
|
|
|
target_include_directories(${_testname} PRIVATE "$<BUILD_INTERFACE:$<TARGET_PROPERTY:KF5PlasmaQuick,INCLUDE_DIRECTORIES>>;")
|
2008-11-04 00:08:39 +01:00
|
|
|
ENDFOREACH(_testname)
|
|
|
|
ENDMACRO(PLASMA_UNIT_TESTS)
|
|
|
|
|
|
|
|
PLASMA_UNIT_TESTS(
|
2014-09-26 09:55:25 +02:00
|
|
|
dialogqmltest
|
2016-07-15 09:28:16 +02:00
|
|
|
dialogstatetest
|
2014-09-01 15:51:05 +02:00
|
|
|
fallbackpackagetest
|
2008-11-04 00:08:39 +01:00
|
|
|
packagestructuretest
|
2013-09-12 01:31:37 +02:00
|
|
|
pluginloadertest
|
2014-07-21 19:38:11 +02:00
|
|
|
framesvgtest
|
2016-02-27 21:24:45 +01:00
|
|
|
iconitemtest
|
2016-04-01 15:06:31 +02:00
|
|
|
themetest
|
2016-05-04 17:33:18 +02:00
|
|
|
configmodeltest
|
2013-02-15 16:31:26 +01:00
|
|
|
# plasmoidpackagetest
|
2008-11-04 00:08:39 +01:00
|
|
|
)
|
2011-04-28 15:19:42 +02:00
|
|
|
|
2017-06-06 14:45:10 +02:00
|
|
|
set(storagetest_libs Qt5::Gui Qt5::Test Qt5::Sql KF5::KIOCore KF5::Plasma KF5::CoreAddons)
|
|
|
|
if(QT_QTOPENGL_FOUND)
|
|
|
|
list(APPEND storagetest_libs Qt5::OpenGL)
|
|
|
|
endif()
|
|
|
|
set(storagetest_srcs storagetest.cpp ../src/plasma/private/storage.cpp ../src/plasma/private/storagethread.cpp ../src/plasma/debug_p.cpp)
|
|
|
|
ecm_add_test(${storagetest_srcs} TEST_NAME plasma-storagetest LINK_LIBRARIES ${storagetest_libs})
|
2014-07-11 22:01:56 +02:00
|
|
|
|
2014-09-30 19:03:54 +02:00
|
|
|
if(HAVE_X11)
|
|
|
|
set(dialognativetest_srcs dialognativetest.cpp)
|
|
|
|
ecm_add_test(${dialognativetest_srcs} TEST_NAME dialognativetest LINK_LIBRARIES Qt5::Gui Qt5::Test Qt5::Qml Qt5::Quick KF5::WindowSystem KF5::Plasma KF5::PlasmaQuick)
|
|
|
|
endif()
|
2014-07-11 22:01:56 +02:00
|
|
|
|
|
|
|
set(coronatest_srcs coronatest.cpp)
|
|
|
|
qt5_add_resources(coronatest_srcs coronatestresources.qrc)
|
2014-07-14 14:22:36 +02:00
|
|
|
ecm_add_test(${coronatest_srcs} TEST_NAME coronatest LINK_LIBRARIES Qt5::Gui Qt5::Widgets Qt5::Test KF5::KIOCore KF5::Plasma KF5::CoreAddons KF5::XmlGui)
|
2014-07-11 22:01:56 +02:00
|
|
|
|
2017-06-06 14:45:10 +02:00
|
|
|
set(sortfiltermodeltest_srcs
|
2014-04-16 18:00:11 +02:00
|
|
|
sortfiltermodeltest.cpp
|
|
|
|
../src/declarativeimports/core/datamodel.cpp
|
|
|
|
../src/declarativeimports/core/datasource.cpp
|
|
|
|
)
|
2017-06-06 14:45:10 +02:00
|
|
|
ecm_add_test(${sortfiltermodeltest_srcs} TEST_NAME plasma-sortfiltermodeltest LINK_LIBRARIES KF5::Plasma Qt5::Gui Qt5::Test KF5::I18n KF5::Service Qt5::Qml)
|
2014-06-05 11:57:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
#Add a test that i18n is not used directly in any import.
|
|
|
|
# It should /always/ be i18nd
|
|
|
|
find_program(SH bash)
|
2017-06-06 16:09:25 +02:00
|
|
|
if(SH)
|
|
|
|
add_test(i18ndcheck ${SH} ${CMAKE_CURRENT_SOURCE_DIR}/i18ndcheck.sh ${CMAKE_SOURCE_DIR}/src/declarativeimports)
|
|
|
|
endif()
|