Skip to content

Add tests for viewer UI - #14768

Merged
Nir-Az merged 13 commits into
realsenseai:developmentfrom
AviaAv:realsense-viewer-tests
Mar 23, 2026
Merged

Nir-Az merged 13 commits into
realsenseai:developmentfrom
AviaAv:realsense-viewer-tests

Conversation

@AviaAv

@AviaAv AviaAv commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Tracked on: [RSDEV-6174]

Copilot AI review requested due to automatic review settings February 26, 2026 09:15
Comment thread common/option-model.h

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from private to public in order to use these methods on viewer tests

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@AviaAv
AviaAv requested a review from Nir-Az February 26, 2026 10:30
@AviaAv
AviaAv force-pushed the realsense-viewer-tests branch 2 times, most recently from 4bb918a to 44fce98 Compare March 2, 2026 10:14
Comment thread tools/realsense-viewer/CMakeLists.txt Resolved
Comment thread tools/CMakeLists.txt Resolved
@AviaAv
AviaAv force-pushed the realsense-viewer-tests branch from fb13385 to f169290 Compare March 5, 2026 10:53
Comment thread third-party/implot/implot_items.cpp Resolved
Comment thread tools/depth-quality/CMakeLists.txt Resolved
@Nir-Az

Nir-Az commented Mar 5, 2026

Copy link
Copy Markdown
Collaborator

@AviaAv ci fails expected?

@AviaAv

AviaAv commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

@AviaAv ci fails expected?

Not expected, test was supposed to be marked as nightly, fixed

@AviaAv
AviaAv requested a review from Nir-Az March 8, 2026 12:16
@AviaAv
AviaAv force-pushed the realsense-viewer-tests branch 3 times, most recently from dadce98 to d81e6d9 Compare March 9, 2026 18:23
Comment thread tools/realsense-viewer/CMakeLists.txt Resolved
Comment thread tools/realsense-viewer/CMakeLists.txt Resolved
Comment thread tools/realsense-viewer/CMakeLists.txt Resolved
Comment thread tools/realsense-viewer/CMakeLists.txt Resolved
@AviaAv
AviaAv requested a review from Nir-Az March 17, 2026 10:05
@Nir-Az

Nir-Az commented Mar 17, 2026

Copy link
Copy Markdown
Collaborator

@AviaAv please run release_flow on your branch to see no issues

@AviaAv
AviaAv force-pushed the realsense-viewer-tests branch from 4b2f9b4 to e3a8afd Compare March 18, 2026 07:50
Comment thread tools/depth-quality/CMakeLists.txt Resolved
Comment thread tools/realsense-viewer/CMakeLists.txt Resolved
Comment thread tools/tools_common.cmake Resolved
@AviaAv
AviaAv requested a review from Nir-Az March 23, 2026 14:49

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work😎

@Nir-Az
Nir-Az merged commit 4afe0ed into realsenseai:development Mar 23, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants