Config parses and validates the JSON settings (D34): required device name and broker host, defaults, type checks, device id from ha_unique_id or derived from the name (D31), warnings for unknown keys and for a password in a file others can read. Dashboard::prepare() loads it in overlay and desktop mode; --config selects another file (D22). New static library frameassistant_lib for app logic; tst_config covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
2.0 KiB
CMake
43 lines
2.0 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)
|