Repository navigation
Add tests for viewer UI - #14768
Add tests for viewer UI#14768
Conversation
There was a problem hiding this comment.
Changed from private to public in order to use these methods on viewer tests
There was a problem hiding this comment.
Pull request overview
This PR adds automated GUI testing infrastructure for the RealSense viewer using the imgui_test_engine framework. The changes refactor the viewer entry point to support test hooks and introduce comprehensive UI tests covering device detection, streaming, and control interactions.
Changes:
- Refactored viewer entry point to extract
run_viewer()function with optional test hooks (on_setup, keep_alive, on_teardown) - Added new test infrastructure with helper classes and macros for registering and running UI tests
- Implemented test cases for device operations, streaming workflows, and control panel interactions
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/realsense-viewer/viewer-main.cpp | New minimal main entry point that calls run_viewer() |
| tools/realsense-viewer/tests/viewer-test-main.cpp | Test harness that integrates imgui_test_engine with viewer |
| tools/realsense-viewer/tests/viewer-test-helpers.h | Test helper API declarations for UI interactions |
| tools/realsense-viewer/tests/viewer-test-helpers.cpp | Test helper implementations for sensors, controls, and streaming |
| tools/realsense-viewer/tests/test-streaming.cpp | Tests for streaming individual and multiple sensors |
| tools/realsense-viewer/tests/test-device.cpp | Tests for device detection and hardware reset |
| tools/realsense-viewer/tests/test-controls.cpp | Tests for sensor controls and resolution selection |
| tools/realsense-viewer/realsense-viewer.h | API declaration for run_viewer with optional callbacks |
| tools/realsense-viewer/realsense-viewer.cpp | Refactored main viewer logic into run_viewer function |
| tools/realsense-viewer/CMakeLists.txt | Added BUILD_VIEWER_TESTS option and test target configuration |
| common/viewer.cpp | Added ImGuiWindowFlags_NoBringToFrontOnFocus to prevent focus issues during tests |
| common/option-model.h | Made is_all_integers, is_enum, is_checkbox methods public for test access |
| CMake/lrs_options.cmake | Added BUILD_VIEWER_TESTS CMake option |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4bb918a to
44fce98
Compare
fb13385 to
f169290
Compare
|
@AviaAv ci fails expected? |
Not expected, test was supposed to be marked as nightly, fixed |
dadce98 to
d81e6d9
Compare
|
@AviaAv please run release_flow on your branch to see no issues |
4b2f9b4 to
e3a8afd
Compare
Tracked on: [RSDEV-6174]