Warning, /frameworks/kconfig/autotests/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 include(ECMAddTests)
0002 
0003 find_package(Qt${QT_MAJOR_VERSION}Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
0004 find_package(Qt${QT_MAJOR_VERSION}Concurrent ${REQUIRED_QT_VERSION} CONFIG QUIET)
0005 
0006 if(NOT Qt${QT_MAJOR_VERSION}Test_FOUND)
0007     message(STATUS "Qt5Test not found, autotests will not be built.")
0008     return()
0009 endif()
0010 
0011 if(NOT Qt${QT_MAJOR_VERSION}Concurrent_FOUND)
0012     message(STATUS "Qt5Concurrent not found, autotests will not be built.")
0013     return()
0014 endif()
0015 
0016 # compile KEntryMap into the test since it's not exported
0017 ecm_add_test(
0018   kentrymaptest.cpp
0019   ../src/core/kconfigdata.cpp
0020   TEST_NAME kentrymaptest
0021   LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test
0022 )
0023 target_include_directories(kentrymaptest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src/core)
0024 
0025 # compile KConfigUtils into the test since it's not exported
0026 ecm_add_test(
0027   test_kconfigutils.cpp
0028   ../src/kconf_update/kconfigutils.cpp
0029   TEST_NAME test_kconfigutils
0030   LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Test
0031 )
0032 target_include_directories(test_kconfigutils PRIVATE ../src/kconf_update)
0033 
0034 qt_add_resources(sharedconfigresources sharedconfigresources.qrc)
0035 
0036 ecm_add_test(ksharedconfigtest.cpp ${sharedconfigresources} TEST_NAME kconfigcore-ksharedconfigtest LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Concurrent)
0037 
0038 # test for fallback to :/kconfig/xxxx config resource
0039 qt_add_resources(fallbackconfigresources fallbackconfigresources.qrc)
0040 ecm_add_test(fallbackconfigresourcestest.cpp ${fallbackconfigresources} TEST_NAME kconfigcore-fallbackconfigresourcestest LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Concurrent)
0041 
0042 ecm_add_tests(
0043    kconfignokdehometest.cpp
0044    kconfigtest.cpp
0045    kdesktopfiletest.cpp
0046    test_kconf_update.cpp
0047    ksharedconfig_in_global_object.cpp
0048    dbussanitizertest.cpp
0049    NAME_PREFIX kconfigcore-
0050    LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Concurrent
0051 )
0052 
0053 target_include_directories(test_kconf_update PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src/kconf_update)
0054 
0055 if(TARGET Qt${QT_MAJOR_VERSION}::Gui)
0056 ecm_add_tests(
0057    kconfigguitest.cpp
0058    kconfigloadertest.cpp
0059    kconfigskeletontest.cpp
0060    kstandardshortcuttest.cpp
0061    NAME_PREFIX kconfiggui-
0062    LINK_LIBRARIES KF5::ConfigGui Qt${QT_MAJOR_VERSION}::Test
0063 )
0064 
0065 ecm_add_test(
0066    kstandardshortcutwatchertest.cpp
0067    # add sources instead of linking so we can use the unexported initialize()
0068    ../src/gui/kstandardshortcut.cpp
0069    ../src/gui/kstandardshortcutwatcher.cpp
0070    LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Gui Qt${QT_MAJOR_VERSION}::Test
0071    TEST_NAME kstandardshortcutwatchertest
0072    NAME_PREFIX kconfiggui-
0073 )
0074 target_include_directories(kstandardshortcutwatchertest PRIVATE "$<TARGET_PROPERTY:KF5ConfigGui,INTERFACE_INCLUDE_DIRECTORIES>")
0075 target_compile_definitions(kstandardshortcutwatchertest PRIVATE "-DKCONFIGGUI_STATIC_DEFINE")
0076 
0077 # These tests do a global cleanup of ~/.qttest, so they can't run in parallel
0078 set_tests_properties(kconfigcore-kconfigtest PROPERTIES RUN_SERIAL TRUE)
0079 set_tests_properties(kconfigcore-kconfignokdehometest PROPERTIES RUN_SERIAL TRUE)
0080 set_tests_properties(kconfiggui-kconfigguitest PROPERTIES RUN_SERIAL TRUE)
0081 
0082 if (NOT CMAKE_CROSSCOMPILING)
0083     add_subdirectory(kconfig_compiler)
0084 endif()
0085 endif()
0086 
0087 find_package(Qt${QT_MAJOR_VERSION} OPTIONAL_COMPONENTS Widgets)
0088 if (TARGET Qt${QT_MAJOR_VERSION}::Widgets)
0089     ecm_add_test(kwindowstatesavertest.cpp LINK_LIBRARIES KF5::ConfigGui Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets)
0090 endif()