|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
|
|
|
|
|
remove_definitions(-DQT_NO_CAST_FROM_ASCII) |
|
|
|
|
|
|
|
|
|
include(ECMMarkAsTest) |
|
|
|
|
include(ECMAddTests) |
|
|
|
|
|
|
|
|
|
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET) |
|
|
|
|
find_package(Qt5Concurrent ${REQUIRED_QT_VERSION} CONFIG QUIET) |
|
|
|
|
@ -16,54 +16,40 @@ if(NOT Qt5Concurrent_FOUND) |
|
|
|
|
return() |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
macro(KCONFIGCORE_UNIT_TESTS) |
|
|
|
|
foreach(_testname ${ARGN}) |
|
|
|
|
add_executable(${_testname} ${_testname}.cpp) # TODO NOGUI |
|
|
|
|
add_test(kconfigcore-${_testname} ${_testname}) |
|
|
|
|
target_link_libraries(${_testname} KF5::ConfigCore Qt5::Test Qt5::Concurrent) |
|
|
|
|
ecm_mark_as_test(${_testname}) |
|
|
|
|
endforeach() |
|
|
|
|
endmacro() |
|
|
|
|
|
|
|
|
|
macro(KCONFIGGUI_UNIT_TESTS) |
|
|
|
|
foreach(_testname ${ARGN}) |
|
|
|
|
add_executable(${_testname} ${_testname}.cpp) |
|
|
|
|
add_test(kconfiggui-${_testname} ${_testname}) |
|
|
|
|
target_link_libraries(${_testname} KF5::ConfigGui Qt5::Test) |
|
|
|
|
ecm_mark_as_test(${_testname}) |
|
|
|
|
endforeach() |
|
|
|
|
endmacro() |
|
|
|
|
|
|
|
|
|
kconfigcore_unit_tests( |
|
|
|
|
kconfignokdehometest |
|
|
|
|
kconfigtest |
|
|
|
|
kdesktopfiletest |
|
|
|
|
ksharedconfigtest |
|
|
|
|
test_kconf_update |
|
|
|
|
ecm_add_tests( |
|
|
|
|
kconfignokdehometest.cpp |
|
|
|
|
kconfigtest.cpp |
|
|
|
|
kdesktopfiletest.cpp |
|
|
|
|
ksharedconfigtest.cpp |
|
|
|
|
test_kconf_update.cpp |
|
|
|
|
NAME_PREFIX kconfigcore- |
|
|
|
|
LINK_LIBRARIES KF5::ConfigCore Qt5::Test Qt5::Concurrent |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
target_include_directories(test_kconf_update PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src/kconf_update) |
|
|
|
|
target_include_directories(kconfigcore-test_kconf_update PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src/kconf_update) |
|
|
|
|
|
|
|
|
|
# compile KEntryMap into the test since it's not exported |
|
|
|
|
set(kentrymaptest_SRCS kentrymaptest.cpp ../src/core/kconfigdata.cpp) |
|
|
|
|
add_executable(kentrymaptest ${kentrymaptest_SRCS}) |
|
|
|
|
add_test(kconfigcore-kentrymaptest kentrymaptest) |
|
|
|
|
target_link_libraries(kentrymaptest KF5::ConfigCore Qt5::Test) |
|
|
|
|
ecm_mark_as_test(kentrymaptest) |
|
|
|
|
ecm_add_test(${kentrymaptest_SRCS} |
|
|
|
|
TEST_NAME kconfigcore-kentrymaptest |
|
|
|
|
LINK_LIBRARIES KF5::ConfigCore Qt5::Test |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# compile KConfigUtils into the test since it's not exported |
|
|
|
|
set(test_kconfigutils_SRCS test_kconfigutils ../src/kconf_update/kconfigutils.cpp) |
|
|
|
|
add_executable(test_kconfigutils ${test_kconfigutils_SRCS}) |
|
|
|
|
add_test(kconfigcore-test_kconfigutils test_kconfigutils) |
|
|
|
|
target_link_libraries(test_kconfigutils KF5::ConfigCore Qt5::Test) |
|
|
|
|
target_include_directories(test_kconfigutils PRIVATE ../src/kconf_update) |
|
|
|
|
ecm_mark_as_test(test_kconfigutils) |
|
|
|
|
|
|
|
|
|
kconfiggui_unit_tests( |
|
|
|
|
kconfigguitest |
|
|
|
|
kconfigloadertest |
|
|
|
|
kconfigskeletontest |
|
|
|
|
kstandardshortcuttest |
|
|
|
|
ecm_add_test(${test_kconfigutils_SRCS} |
|
|
|
|
TEST_NAME kconfigcore-test_kconfigutils |
|
|
|
|
LINK_LIBRARIES KF5::ConfigCore Qt5::Test |
|
|
|
|
) |
|
|
|
|
target_include_directories(kconfigcore-test_kconfigutils PRIVATE ../src/kconf_update) |
|
|
|
|
|
|
|
|
|
ecm_add_tests( |
|
|
|
|
kconfigguitest.cpp |
|
|
|
|
kconfigloadertest.cpp |
|
|
|
|
kconfigskeletontest.cpp |
|
|
|
|
kstandardshortcuttest.cpp |
|
|
|
|
NAME_PREFIX kconfiggui- |
|
|
|
|
LINK_LIBRARIES KF5::ConfigGui Qt5::Test |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
add_subdirectory(kconfig_compiler) |
|
|
|
|
|