Refactor PollHandler to make it more reliable. This ended up with much more code than I expected as the original intent was just to stop a crash when switching rooms. - Using a event string was flaky, changing to using an event reference is more reliable. - Since we're only creating them from NeoChatRoom there is no need to to be able to set properties from QML so only read properties. - Pass from the MessageEventModel rather than an invokable method. - Create a basic test suite - Create properties in PollHandler to remove the need to use content in PollDelegate, this means content is no longer a required role.
73 lines
1.4 KiB
CMake
73 lines
1.4 KiB
CMake
# SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
enable_testing()
|
|
|
|
add_definitions(-DDATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data" )
|
|
|
|
ecm_add_test(
|
|
neochatroomtest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME neochatroomtest
|
|
)
|
|
|
|
ecm_add_test(
|
|
texthandlertest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME texthandlertest
|
|
)
|
|
|
|
ecm_add_test(
|
|
delegatesizehelpertest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME delegatesizehelpertest
|
|
)
|
|
|
|
ecm_add_test(
|
|
mediasizehelpertest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME mediasizehelpertest
|
|
)
|
|
|
|
ecm_add_test(
|
|
eventhandlertest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME eventhandlertest
|
|
)
|
|
|
|
ecm_add_test(
|
|
chatbarcachetest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME chatbarcachetest
|
|
)
|
|
|
|
ecm_add_test(
|
|
chatdocumenthandlertest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME chatdocumenthandlertest
|
|
)
|
|
|
|
ecm_add_test(
|
|
messageeventmodeltest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME messageeventmodeltest
|
|
)
|
|
|
|
ecm_add_test(
|
|
actionshandlertest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME actionshandlertest
|
|
)
|
|
|
|
ecm_add_test(
|
|
windowcontrollertest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME windowcontrollertest
|
|
)
|
|
|
|
ecm_add_test(
|
|
pollhandlertest.cpp
|
|
LINK_LIBRARIES neochat Qt::Test
|
|
TEST_NAME pollhandlertest
|
|
)
|