Warning, /libraries/kirigami-addons/autotests/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2021 Arjen Hiemstra <ahiemstra@heimr.nl>
0002 # SPDX-License-Identifier: BSD-2-Clause
0003 
0004 add_definitions(-DDATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data")
0005 
0006 if(NOT Qt6QuickTest_FOUND)
0007     message(STATUS "QtQuickTest not found, autotests will not be built.")
0008     return()
0009 endif()
0010 
0011 add_library(test-artefacts STATIC
0012     example_albummodel.cpp
0013 )
0014 
0015 target_link_libraries(test-artefacts
0016     Qt6::Core
0017     Qt6::Gui
0018 )
0019 
0020 add_executable(qmltest qmltests.cpp)
0021 
0022 target_link_libraries(qmltest
0023     test-artefacts
0024     Qt6::QuickTest
0025     Qt6::Qml
0026     KF6::I18n
0027 )
0028 
0029 macro(kirigami_add_tests)
0030     if (WIN32)
0031         set(_extra_args -platform offscreen)
0032     endif()
0033 
0034     foreach(test ${ARGV})
0035         add_test(NAME ${test}
0036                  COMMAND qmltest
0037                         ${_extra_args}
0038                         -import ${CMAKE_BINARY_DIR}/bin
0039                         -input ${test}
0040                  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
0041         )
0042     endforeach()
0043 endmacro()
0044 
0045 kirigami_add_tests(
0046     tst_avatar.qml
0047     tst_sounds.qml
0048     tst_album_qmllistmodel.qml
0049     tst_album_abstractlistmodel.qml
0050     tst_album_qmlqobjectmodel.qml
0051 )