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
|
|
|
|
2022-08-08 09:31:24 +00:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
2023-12-18 21:28:04 +00:00
|
|
|
find_package(Qt5 COMPONENTS QuickTest Qml Quick WebEngine REQUIRED)
|
2022-03-10 18:49:42 +00:00
|
|
|
|
2023-12-18 21:28:04 +00:00
|
|
|
##############
|
|
|
|
# Test Library
|
|
|
|
##############
|
2022-03-10 18:49:42 +00:00
|
|
|
|
2023-12-18 21:28:04 +00:00
|
|
|
add_library(StatusQTestLib
|
|
|
|
src/TestHelpers/MonitorQtOutput.cpp
|
|
|
|
src/TestHelpers/MonitorQtOutput.h
|
2023-12-21 13:46:09 +00:00
|
|
|
src/TestHelpers/listmodelwrapper.cpp
|
|
|
|
src/TestHelpers/listmodelwrapper.h
|
2023-12-19 15:24:31 +00:00
|
|
|
src/TestHelpers/modelaccessobserverproxy.cpp
|
|
|
|
src/TestHelpers/modelaccessobserverproxy.h
|
2024-01-16 09:31:24 +00:00
|
|
|
src/TestHelpers/modelsignalsspy.cpp
|
|
|
|
src/TestHelpers/modelsignalsspy.h
|
2024-01-16 09:49:52 +00:00
|
|
|
src/TestHelpers/modeltestutils.cpp
|
|
|
|
src/TestHelpers/modeltestutils.h
|
2024-02-21 13:29:57 +00:00
|
|
|
src/TestHelpers/persistentindexestester.cpp
|
|
|
|
src/TestHelpers/persistentindexestester.h
|
2023-12-21 15:06:52 +00:00
|
|
|
src/TestHelpers/testmodel.cpp
|
|
|
|
src/TestHelpers/testmodel.h
|
2023-12-18 21:28:04 +00:00
|
|
|
)
|
2022-03-10 18:49:42 +00:00
|
|
|
|
2024-06-04 10:08:52 +00:00
|
|
|
target_link_libraries(StatusQTestLib PUBLIC Qt5::Core Qt5::Quick Qt5::Test StatusQ)
|
2023-12-18 21:28:04 +00:00
|
|
|
target_include_directories(StatusQTestLib PUBLIC src)
|
2022-04-19 17:45:26 +00:00
|
|
|
|
2023-12-18 21:28:04 +00:00
|
|
|
enable_testing()
|
2022-03-10 18:49:42 +00:00
|
|
|
|
2023-12-18 21:28:04 +00:00
|
|
|
###########
|
|
|
|
# QML Tests
|
|
|
|
###########
|
2022-03-21 11:04:11 +00:00
|
|
|
|
2023-12-18 21:28:04 +00:00
|
|
|
file(GLOB_RECURSE TEST_QML_FILES "*.qml")
|
|
|
|
add_executable(QmlTests main.cpp "${TEST_QML_FILES}")
|
2022-03-21 11:04:11 +00:00
|
|
|
|
2023-12-18 21:28:04 +00: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 11:04:11 +00:00
|
|
|
)
|
2023-04-14 08:18:56 +00:00
|
|
|
|
2023-12-18 21:28:04 +00:00
|
|
|
###########
|
|
|
|
# C++ Tests
|
|
|
|
###########
|
2023-10-24 08:55:25 +00:00
|
|
|
|
2024-11-13 15:03:47 +00:00
|
|
|
add_executable(ModelUtilsInternalTest tst_ModelUtilsInternal.cpp)
|
|
|
|
target_link_libraries(ModelUtilsInternalTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME ModelUtilsInternalTest COMMAND ModelUtilsInternalTest)
|
|
|
|
|
2023-10-24 08:55:25 +00:00
|
|
|
add_executable(RolesRenamingModelTest tst_RolesRenamingModel.cpp)
|
2024-01-16 09:31:24 +00:00
|
|
|
target_link_libraries(RolesRenamingModelTest PRIVATE StatusQ StatusQTestLib)
|
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)
|
2024-01-16 09:31:24 +00:00
|
|
|
target_link_libraries(LeftJoinModelTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-23 11:38:09 +00:00
|
|
|
add_test(NAME LeftJoinModelTest COMMAND LeftJoinModelTest)
|
2023-11-04 20:32:54 +00:00
|
|
|
|
2024-05-29 11:06:29 +00:00
|
|
|
add_executable(ObjectProxyModelTest tst_ObjectProxyModel.cpp)
|
|
|
|
target_link_libraries(ObjectProxyModelTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME ObjectProxyModelTest COMMAND ObjectProxyModelTest)
|
|
|
|
|
2023-11-30 12:50:04 +00:00
|
|
|
add_executable(AggregatorTest tst_Aggregator.cpp)
|
2024-01-16 09:31:24 +00:00
|
|
|
target_link_libraries(AggregatorTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-30 12:50:04 +00:00
|
|
|
add_test(NAME AggregatorTest COMMAND AggregatorTest)
|
|
|
|
|
|
|
|
add_executable(SingleRoleAggregatorTest tst_SingleRoleAggregator.cpp)
|
2024-01-16 09:31:24 +00:00
|
|
|
target_link_libraries(SingleRoleAggregatorTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-30 12:50:04 +00:00
|
|
|
add_test(NAME SingleRoleAggregatorTest COMMAND SingleRoleAggregatorTest)
|
|
|
|
|
|
|
|
add_executable(SumAggregatorTest tst_SumAggregator.cpp)
|
2024-01-16 09:31:24 +00:00
|
|
|
target_link_libraries(SumAggregatorTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-30 12:50:04 +00:00
|
|
|
add_test(NAME SumAggregatorTest COMMAND SumAggregatorTest)
|
2023-11-22 09:28:53 +00:00
|
|
|
|
2024-05-07 14:18:49 +00:00
|
|
|
add_executable(FunctionAggregatorTest tst_FunctionAggregator.cpp)
|
|
|
|
target_link_libraries(FunctionAggregatorTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME FunctionAggregatorTest COMMAND FunctionAggregatorTest)
|
|
|
|
|
2023-11-22 09:28:53 +00:00
|
|
|
add_executable(ConcatModelTest tst_ConcatModel.cpp)
|
2024-04-09 12:14:12 +00:00
|
|
|
target_link_libraries(ConcatModelTest PRIVATE StatusQ StatusQTestLib SortFilterProxyModel)
|
2023-11-22 09:28:53 +00:00
|
|
|
add_test(NAME ConcatModelTest COMMAND ConcatModelTest)
|
2023-11-28 16:35:09 +00:00
|
|
|
|
|
|
|
add_executable(WritableProxyModelTest tst_WritableProxyModel.cpp)
|
2024-01-16 10:18:49 +00:00
|
|
|
target_link_libraries(WritableProxyModelTest PRIVATE StatusQ StatusQTestLib)
|
2023-11-28 16:35:09 +00:00
|
|
|
add_test(NAME WritableProxyModelTest COMMAND WritableProxyModelTest)
|
2024-01-16 10:18:49 +00:00
|
|
|
|
|
|
|
add_executable(MovableModelTest tst_MovableModel.cpp)
|
|
|
|
target_link_libraries(MovableModelTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME MovableModelTest COMMAND MovableModelTest)
|
2024-05-20 13:42:09 +00:00
|
|
|
|
|
|
|
add_executable(ModelSyncedContainerTest tst_ModelSyncedContainer.cpp)
|
|
|
|
target_link_libraries(ModelSyncedContainerTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME ModelSyncedContainerTest COMMAND ModelSyncedContainerTest)
|
2024-06-04 10:08:52 +00: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 14:32:48 +00: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 09:25:03 +00:00
|
|
|
|
|
|
|
add_executable(ModelCountTest tst_ModelCount.cpp)
|
|
|
|
target_link_libraries(ModelCountTest PRIVATE StatusQ StatusQTestLib)
|
|
|
|
add_test(NAME ModelCountTest COMMAND ModelCountTest)
|