2022-03-10 19:49:42 +01:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2022-04-19 21:45:26 +04:00
|
|
|
project(TestStatusQ LANGUAGES CXX)
|
2022-03-10 19:49:42 +01:00
|
|
|
|
2022-08-08 11:31:24 +02:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
2023-12-18 22:28:04 +01:00
|
|
|
find_package(Qt5 COMPONENTS QuickTest Qml Quick WebEngine REQUIRED)
|
2022-03-10 19:49:42 +01:00
|
|
|
|
2023-12-18 22:28:04 +01:00
|
|
|
##############
|
|
|
|
# Test Library
|
|
|
|
##############
|
2022-03-10 19:49:42 +01:00
|
|
|
|
2023-12-18 22:28:04 +01:00
|
|
|
add_library(StatusQTestLib
|
|
|
|
src/TestHelpers/MonitorQtOutput.cpp
|
|
|
|
src/TestHelpers/MonitorQtOutput.h
|
2023-12-21 14:46:09 +01:00
|
|
|
src/TestHelpers/listmodelwrapper.cpp
|
|
|
|
src/TestHelpers/listmodelwrapper.h
|
2023-12-19 16:24:31 +01:00
|
|
|
src/TestHelpers/modelaccessobserverproxy.cpp
|
|
|
|
src/TestHelpers/modelaccessobserverproxy.h
|
2024-01-16 10:31:24 +01:00
|
|
|
src/TestHelpers/modelsignalsspy.cpp
|
|
|
|
src/TestHelpers/modelsignalsspy.h
|
2024-01-16 10:49:52 +01:00
|
|
|
src/TestHelpers/modeltestutils.cpp
|
|
|
|
src/TestHelpers/modeltestutils.h
|
2024-02-21 14:29:57 +01:00
|
|
|
src/TestHelpers/persistentindexestester.cpp
|
|
|
|
src/TestHelpers/persistentindexestester.h
|
2023-12-21 16:06:52 +01:00
|
|
|
src/TestHelpers/testmodel.cpp
|
|
|
|
src/TestHelpers/testmodel.h
|
2023-12-18 22:28:04 +01:00
|
|
|
)
|
2022-03-10 19:49:42 +01:00
|
|
|
|
2024-06-04 13:08:52 +03:00
|
|
|
target_link_libraries(StatusQTestLib PUBLIC Qt5::Core Qt5::Quick Qt5::Test StatusQ)
|
2023-12-18 22:28:04 +01:00
|
|
|
target_include_directories(StatusQTestLib PUBLIC src)
|
2022-04-19 21:45:26 +04:00
|
|
|
|
2023-12-18 22:28:04 +01:00
|
|
|
enable_testing()
|
2022-03-10 19:49:42 +01:00
|
|
|
|
2023-12-18 22:28:04 +01:00
|
|
|
###########
|
|
|
|
# QML Tests
|
|
|
|
###########
|
2022-03-21 13:04:11 +02:00
|
|
|
|
2023-12-18 22:28:04 +01:00
|
|
|
file(GLOB_RECURSE TEST_QML_FILES "*.qml")
|
|
|
|
add_executable(QmlTests main.cpp "${TEST_QML_FILES}")
|
2022-03-21 13:04:11 +02:00
|
|
|
|
2023-12-18 22:28:04 +01:00
|
|
|
target_compile_definitions(QmlTests PRIVATE
|
|
|
|
STATUSQ_MODULE_IMPORT_PATH="${STATUSQ_MODULE_IMPORT_PATH}"
|
|
|
|
# no need to copy around qml test files for shadow builds - just set the respective define
|
|
|
|
QUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
target_link_libraries(QmlTests PRIVATE Qt5::QuickTest Qt5::Qml Qt5::Quick
|
|
|
|
Qt5::WebEngine StatusQ StatusQTestLib
|
|
|
|
)
|
|
|
|
add_test(NAME QmlTests WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
COMMAND QmlTests -input "${CMAKE_CURRENT_SOURCE_DIR}"
|
2022-03-21 13:04:11 +02:00
|
|
|
)
|
2023-04-14 11:18:56 +03:00
|
|
|
|
2023-12-18 22:28:04 +01:00
|
|
|
###########
|
|
|
|
# C++ Tests
|
|
|
|
###########
|
2023-10-24 10:55:25 +02:00
|
|
|
|
|
|
|
add_executable(RolesRenamingModelTest tst_RolesRenamingModel.cpp)
|
2024-01-16 10:31:24 +01:00
|
|
|
target_link_libraries(RolesRenamingModelTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-23 12:38:09 +01:00
|
|
|
add_test(NAME RolesRenamingModelTest COMMAND RolesRenamingModelTest)
|
2023-10-24 11:08:30 +02:00
|
|
|
|
|
|
|
add_executable(LeftJoinModelTest tst_LeftJoinModel.cpp)
|
2024-01-16 10:31:24 +01:00
|
|
|
target_link_libraries(LeftJoinModelTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-23 12:38:09 +01:00
|
|
|
add_test(NAME LeftJoinModelTest COMMAND LeftJoinModelTest)
|
2023-11-04 21:32:54 +01:00
|
|
|
|
2024-05-29 13:06:29 +02:00
|
|
|
add_executable(ObjectProxyModelTest tst_ObjectProxyModel.cpp)
|
|
|
|
target_link_libraries(ObjectProxyModelTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME ObjectProxyModelTest COMMAND ObjectProxyModelTest)
|
|
|
|
|
2023-11-30 13:50:04 +01:00
|
|
|
add_executable(AggregatorTest tst_Aggregator.cpp)
|
2024-01-16 10:31:24 +01:00
|
|
|
target_link_libraries(AggregatorTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-30 13:50:04 +01:00
|
|
|
add_test(NAME AggregatorTest COMMAND AggregatorTest)
|
|
|
|
|
|
|
|
add_executable(SingleRoleAggregatorTest tst_SingleRoleAggregator.cpp)
|
2024-01-16 10:31:24 +01:00
|
|
|
target_link_libraries(SingleRoleAggregatorTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-30 13:50:04 +01:00
|
|
|
add_test(NAME SingleRoleAggregatorTest COMMAND SingleRoleAggregatorTest)
|
|
|
|
|
|
|
|
add_executable(SumAggregatorTest tst_SumAggregator.cpp)
|
2024-01-16 10:31:24 +01:00
|
|
|
target_link_libraries(SumAggregatorTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-30 13:50:04 +01:00
|
|
|
add_test(NAME SumAggregatorTest COMMAND SumAggregatorTest)
|
2023-11-22 10:28:53 +01:00
|
|
|
|
2024-05-07 16:18:49 +02:00
|
|
|
add_executable(FunctionAggregatorTest tst_FunctionAggregator.cpp)
|
|
|
|
target_link_libraries(FunctionAggregatorTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME FunctionAggregatorTest COMMAND FunctionAggregatorTest)
|
|
|
|
|
2023-11-22 10:28:53 +01:00
|
|
|
add_executable(ConcatModelTest tst_ConcatModel.cpp)
|
2024-04-09 14:14:12 +02:00
|
|
|
target_link_libraries(ConcatModelTest PRIVATE StatusQ StatusQTestLib SortFilterProxyModel)
|
2023-11-22 10:28:53 +01:00
|
|
|
add_test(NAME ConcatModelTest COMMAND ConcatModelTest)
|
2023-11-28 18:35:09 +02:00
|
|
|
|
|
|
|
add_executable(WritableProxyModelTest tst_WritableProxyModel.cpp)
|
2024-01-16 11:18:49 +01:00
|
|
|
target_link_libraries(WritableProxyModelTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-28 18:35:09 +02:00
|
|
|
add_test(NAME WritableProxyModelTest COMMAND WritableProxyModelTest)
|
2024-01-16 11:18:49 +01:00
|
|
|
|
|
|
|
add_executable(MovableModelTest tst_MovableModel.cpp)
|
|
|
|
target_link_libraries(MovableModelTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME MovableModelTest COMMAND MovableModelTest)
|
2024-05-20 15:42:09 +02:00
|
|
|
|
|
|
|
add_executable(ModelSyncedContainerTest tst_ModelSyncedContainer.cpp)
|
|
|
|
target_link_libraries(ModelSyncedContainerTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME ModelSyncedContainerTest COMMAND ModelSyncedContainerTest)
|
2024-06-04 13:08:52 +03:00
|
|
|
|
|
|
|
add_executable(ModelEntryTest tst_ModelEntry.cpp)
|
|
|
|
target_link_libraries(ModelEntryTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME ModelEntryTest COMMAND ModelEntryTest)
|
|
|
|
|
|
|
|
add_executable(SnapshotObjectTest tst_SnapshotObject.cpp)
|
|
|
|
target_link_libraries(SnapshotObjectTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-28 15:32:48 +01:00
|
|
|
add_test(NAME SnapshotObjectTest COMMAND SnapshotObjectTest)
|
|
|
|
|
|
|
|
add_executable(GroupingModelTest tst_GroupingModel.cpp)
|
|
|
|
target_link_libraries(GroupingModelTest PRIVATE Qt5::Qml StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME GroupingModelTest COMMAND GroupingModelTest)
|
2024-06-28 11:25:03 +02:00
|
|
|
|
|
|
|
add_executable(ModelCountTest tst_ModelCount.cpp)
|
|
|
|
target_link_libraries(ModelCountTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME ModelCountTest COMMAND ModelCountTest)
|