Files
FrameAssistant/tests/CMakeLists.txt
T
matzmanandClaude Opus 5.5 466743eff9 HA entity, sensor and device classes (iteration 2, step 3)
HaEntity describes an entity for device-based discovery, throttles its
state (SEN-14) and reports availability (SEN-15); HaSensor is the
`sensor` type. HaDevice publishes discovery, availability and states
after each connect and after HA's birth message, provides the last
will and removes itself from HA. Unit tests with a fake MQTT client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:12:43 +02:00

56 lines
2.7 KiB
CMake

find_package(Qt6 REQUIRED COMPONENTS Test)
# Unit tests run without SteamVR or a headset. They use the "offscreen" QPA platform;
# tests that need a GPU context QSKIP themselves when none is available.
qt_add_executable(tst_inputbridge tst_inputbridge.cpp)
target_link_libraries(tst_inputbridge PRIVATE vrdashboard_core Qt6::Test)
add_test(NAME inputbridge COMMAND tst_inputbridge)
qt_add_executable(tst_render tst_render.cpp)
target_link_libraries(tst_render PRIVATE vrdashboard_core Qt6::Test)
qt_add_qml_module(tst_render
URI RenderTest
VERSION 1.0
QML_FILES TwoTone.qml Spinner.qml)
add_test(NAME render_opengl COMMAND tst_render)
set_tests_properties(render_opengl PROPERTIES ENVIRONMENT "VRDASH_TEST_API=opengl")
add_test(NAME render_vulkan COMMAND tst_render)
set_tests_properties(render_vulkan PROPERTIES ENVIRONMENT "VRDASH_TEST_API=vulkan")
set_tests_properties(inputbridge PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
# Two surfaces in one app (snapshot mode): set-up, hooks, rendering per surface.
qt_add_executable(tst_surfaces tst_surfaces.cpp)
target_link_libraries(tst_surfaces PRIVATE vrdashboard_core)
qt_add_qml_module(tst_surfaces
URI SurfacesTest
VERSION 1.0
QML_FILES Red.qml Blue.qml)
add_test(NAME surfaces_opengl COMMAND tst_surfaces --graphics-api opengl)
add_test(NAME surfaces_vulkan COMMAND tst_surfaces --graphics-api vulkan)
add_test(NAME surfaces_cli_key COMMAND tst_surfaces --graphics-api opengl)
set_tests_properties(surfaces_cli_key PROPERTIES ENVIRONMENT "VRDASH_TEST_CLI_KEY=1")
add_test(NAME surfaces_prepare_fail COMMAND tst_surfaces --graphics-api opengl)
set_tests_properties(surfaces_prepare_fail PROPERTIES ENVIRONMENT "VRDASH_TEST_PREPARE_FAIL=1")
set_tests_properties(surfaces_opengl surfaces_vulkan surfaces_cli_key
PROPERTIES SKIP_RETURN_CODE 77)
# The app's settings file (docs/DESIGN.md, D34).
qt_add_executable(tst_config tst_config.cpp)
target_link_libraries(tst_config PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME config COMMAND tst_config)
# HA entities and the HA device (D23, D31, D32); the device with a fake MQTT client.
qt_add_executable(tst_haentity tst_haentity.cpp)
target_link_libraries(tst_haentity PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME haentity COMMAND tst_haentity)
qt_add_executable(tst_hadevice tst_hadevice.cpp FakeMqttClient.h)
target_link_libraries(tst_hadevice PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME hadevice COMMAND tst_hadevice)
# MosquittoClient against a local mosquitto broker (D30 level 2); skips without one.
qt_add_executable(tst_mqtt tst_mqtt.cpp)
target_link_libraries(tst_mqtt PRIVATE frameassistant_lib Qt6::Test)
add_test(NAME mqtt COMMAND tst_mqtt)