mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Extends UI element tests to include signal emission verification. This ensures that UI elements correctly emit signals upon user interaction, improving the reliability and responsiveness of the UI. Adds QSignalSpy to track signal emissions for various UI components like buttons, checkboxes, comboboxes, items, sliders, textboxes and thermos.
41 lines
1004 B
CMake
41 lines
1004 B
CMake
# Third Party
|
|
find_package(GTest QUIET)
|
|
find_package(Qt6 REQUIRED COMPONENTS Core Test)
|
|
set(CMAKE_AUTOUIC ON)
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
# tests
|
|
file(GLOB_RECURSE TEST_SOURCES "*.[hc]pp")
|
|
file(GLOB_RECURSE CAN "../server/CAN/to_id.cpp")
|
|
if (GTest_FOUND)
|
|
message(STATUS "GTest found - building target tests")
|
|
add_executable(tests ${TEST_SOURCES} ${CAN})
|
|
|
|
target_compile_options(tests PRIVATE $<$<CONFIG:Debug>:
|
|
-Wall -Wextra -pedantic-errors -Wconversion -Wsign-conversion
|
|
>)
|
|
|
|
target_link_libraries(tests
|
|
PRIVATE
|
|
UI
|
|
gtest
|
|
magic_enum::magic_enum
|
|
GTest::gtest_main
|
|
Qt::Core
|
|
Qt::Test
|
|
)
|
|
|
|
target_include_directories(tests
|
|
PUBLIC
|
|
${CMAKE_SOURCE_DIR}/external/cpp-templates
|
|
${CMAKE_CURRENT_LIST_DIR}
|
|
${PROJECT_BINARY_DIR}
|
|
)
|
|
|
|
include(GoogleTest)
|
|
gtest_discover_tests(tests)
|
|
else()
|
|
message(STATUS "GTest not found - not building target tests")
|
|
endif()
|