2022-03-10 18:49:42 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2022-04-19 17:45:26 +00:00
|
|
|
project(TestStatusQ LANGUAGES CXX)
|
2022-03-10 18:49:42 +00:00
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
|
2022-08-08 09:31:24 +00:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS QuickTest Qml Quick WebChannel WebEngine REQUIRED)
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS QuickTest Qml Quick WebChannel WebEngine REQUIRED)
|
2022-03-10 18:49:42 +00:00
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
# no need to copy around qml test files for shadow builds - just set the respective define
|
|
|
|
add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
|
2022-03-21 11:04:11 +00:00
|
|
|
add_executable(${PROJECT_NAME} main.cpp)
|
2022-04-19 17:45:26 +00:00
|
|
|
|
2023-10-24 08:55:25 +00:00
|
|
|
add_test(NAME ${PROJECT_NAME} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
2023-11-23 11:38:09 +00:00
|
|
|
COMMAND ${PROJECT_NAME} -input "${CMAKE_CURRENT_SOURCE_DIR}")
|
2022-03-10 18:49:42 +00:00
|
|
|
|
2022-03-21 11:04:11 +00:00
|
|
|
# TODO: move this to a test helpers library
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
PUBLIC
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
|
2022-04-19 17:45:26 +00:00
|
|
|
add_subdirectory(src)
|
2022-03-21 11:04:11 +00:00
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
2022-03-10 18:49:42 +00:00
|
|
|
Qt${QT_VERSION_MAJOR}::QuickTest
|
2022-03-21 11:04:11 +00:00
|
|
|
Qt${QT_VERSION_MAJOR}::Qml
|
|
|
|
Qt${QT_VERSION_MAJOR}::Quick
|
2023-11-15 21:26:12 +00:00
|
|
|
Qt${QT_VERSION_MAJOR}::WebChannel
|
|
|
|
Qt${QT_VERSION_MAJOR}::WebEngine
|
2023-11-23 11:38:09 +00:00
|
|
|
StatusQ
|
2022-03-21 11:04:11 +00:00
|
|
|
)
|
2023-04-14 08:18:56 +00:00
|
|
|
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
|
|
STATUSQ_MODULE_PATH="${STATUSQ_MODULE_PATH}"
|
|
|
|
STATUSQ_MODULE_IMPORT_PATH="${STATUSQ_MODULE_IMPORT_PATH}"
|
|
|
|
)
|
2023-10-24 08:55:25 +00:00
|
|
|
|
|
|
|
add_executable(RolesRenamingModelTest tst_RolesRenamingModel.cpp)
|
|
|
|
target_link_libraries(RolesRenamingModelTest PRIVATE Qt5::Qml Qt5::Test StatusQ)
|
2023-11-23 11:38:09 +00:00
|
|
|
add_test(NAME RolesRenamingModelTest COMMAND RolesRenamingModelTest)
|
2023-10-24 09:08:30 +00:00
|
|
|
|
|
|
|
add_executable(LeftJoinModelTest tst_LeftJoinModel.cpp)
|
|
|
|
target_link_libraries(LeftJoinModelTest PRIVATE Qt5::Test StatusQ)
|
2023-11-23 11:38:09 +00:00
|
|
|
add_test(NAME LeftJoinModelTest COMMAND LeftJoinModelTest)
|
2023-11-04 20:32:54 +00:00
|
|
|
|
|
|
|
add_executable(SubmodelProxyModelTest tst_SubmodelProxyModel.cpp)
|
|
|
|
target_link_libraries(SubmodelProxyModelTest PRIVATE Qt5::Qml Qt5::Test StatusQ)
|
2023-11-23 11:38:09 +00:00
|
|
|
add_test(NAME SubmodelProxyModelTest COMMAND SubmodelProxyModelTest)
|
2023-11-30 12:50:04 +00:00
|
|
|
|
|
|
|
add_executable(AggregatorTest tst_Aggregator.cpp)
|
|
|
|
target_link_libraries(AggregatorTest PRIVATE Qt5::Test StatusQ)
|
|
|
|
add_test(NAME AggregatorTest COMMAND AggregatorTest)
|
|
|
|
|
|
|
|
add_executable(SingleRoleAggregatorTest tst_SingleRoleAggregator.cpp)
|
|
|
|
target_link_libraries(SingleRoleAggregatorTest PRIVATE Qt5::Test StatusQ)
|
|
|
|
add_test(NAME SingleRoleAggregatorTest COMMAND SingleRoleAggregatorTest)
|
|
|
|
|
|
|
|
add_executable(SumAggregatorTest tst_SumAggregator.cpp)
|
|
|
|
target_link_libraries(SumAggregatorTest PRIVATE Qt5::Test StatusQ)
|
|
|
|
add_test(NAME SumAggregatorTest COMMAND SumAggregatorTest)
|
2023-11-22 09:28:53 +00:00
|
|
|
|
|
|
|
add_executable(ConcatModelTest tst_ConcatModel.cpp)
|
|
|
|
target_link_libraries(ConcatModelTest PRIVATE Qt5::Qml Qt5::Test StatusQ)
|
|
|
|
add_test(NAME ConcatModelTest COMMAND ConcatModelTest)
|