From 559ff2ab1556df74d82d78b27176733671660e0b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 19 Aug 2026 00:16:53 +0100 Subject: [PATCH] tests: Move all tests into their own folder Signed-off-by: Jakob Bornecrantz --- .github/workflows/build-ubuntu.yml | 10 ++- CMakeLists.txt | 6 +- cmake/cmake-structure.md | 6 +- docs/source/device/haptic_feedback.rst | 2 +- docs/source/device/trackers.rst | 24 +++---- examples/mujoco_xr/CMakeLists.txt | 31 +++++---- examples/teleop_ros2/python/pyproject.toml | 2 +- src/core/CMakeLists.txt | 34 ---------- src/core/cloudxr_tests/CMakeLists.txt | 9 --- .../retargeting_engine_tests/CMakeLists.txt | 9 --- .../python/__init__.py | 4 -- src/core/schema_tests/CMakeLists.txt | 14 ---- src/core/schema_tests/python/__init__.py | 4 -- .../CMakeLists.txt | 9 --- src/plugins/oglo_tactile/CMakeLists.txt | 13 ---- .../retargeters/SO101/clutch_retargeter.py | 2 +- src/viz/AGENTS.md | 21 +++--- src/viz/CMakeLists.txt | 21 +----- src/viz/core_tests/CMakeLists.txt | 7 -- src/viz/layers/cpp/CMakeLists.txt | 2 +- .../inc/viz/layers/detail/quad_layer_eye.hpp | 23 +++++++ src/viz/layers_testing/CMakeLists.txt | 7 -- src/viz/session_tests/CMakeLists.txt | 7 -- src/viz/test_support/CMakeLists.txt | 8 --- .../cpp/inc/viz/xr/view_config_selection.hpp | 23 +++++++ src/viz/xr/cpp/view_config_selection.cpp | 49 ++++++++++++++ tests/AGENTS.md | 65 +++++++++++++++++++ {src/core/rig_tests => tests}/CMakeLists.txt | 11 +++- tests/cpp/CMakeLists.txt | 12 ++++ .../cpp/core}/CMakeLists.txt | 8 +-- .../cpp/core/live_trackers}/CMakeLists.txt | 0 .../live_trackers}/test_vendor_validation.cpp | 0 .../cpp/core/mcap}/CMakeLists.txt | 2 +- .../core/mcap}/test_mcap_tracker_channels.cpp | 0 .../replay_deviceio_session}/CMakeLists.txt | 0 .../test_replay_session.cpp | 0 .../cpp/core/schema}/CMakeLists.txt | 0 .../cpp/core/schema}/test_controller.cpp | 0 .../cpp/core/schema}/test_full_body.cpp | 2 +- .../cpp/core/schema}/test_hand.cpp | 2 +- .../cpp/core/schema}/test_head.cpp | 2 +- .../cpp/core/schema}/test_oak.cpp | 0 .../cpp/core/schema}/test_pedals.cpp | 0 .../cpp/core/schema}/test_pose.cpp | 2 +- .../cpp/core/schema}/test_se3_tracker.cpp | 0 .../cpp/plugins}/CMakeLists.txt | 4 +- tests/cpp/plugins/oglo_tactile/CMakeLists.txt | 13 ++++ .../oglo_tactile}/test_oglo_packet_parser.cpp | 0 tests/cpp/viz/CMakeLists.txt | 12 ++++ .../cpp => tests/cpp/viz/core}/CMakeLists.txt | 0 .../cpp/viz/core}/test_device_image.cpp | 0 .../cpp/viz/core}/test_frame_sync.cpp | 0 .../cpp/viz/core}/test_host_image.cpp | 0 .../cpp/viz/core}/test_render_target.cpp | 0 .../cpp/viz/core}/test_viz_buffer.cpp | 0 .../cpp/viz/core}/test_viz_types.cpp | 0 .../cpp/viz/core}/test_vk_context.cpp | 0 .../cpp/viz/layers}/CMakeLists.txt | 0 .../cpp/viz/layers}/test_clear_rect_layer.cpp | 0 .../cpp/viz/layers}/test_projection_layer.cpp | 0 .../cpp/viz/layers}/test_quad_layer.cpp | 0 .../cpp/viz/layers}/test_shaped_layers.cpp | 0 .../cpp/viz/layers}/test_throwing_layer.cpp | 0 .../cpp/viz/session}/CMakeLists.txt | 0 .../viz/session}/test_offscreen_render.cpp | 0 .../cpp/viz/session}/test_perf_audit.cpp | 0 .../cpp/viz/session}/test_quad_milestone.cpp | 0 .../cpp/viz/session}/test_tile_layout.cpp | 0 .../cpp/viz/session}/test_viz_session.cpp | 0 .../viz/session}/test_window_primitives.cpp | 0 .../cpp/viz/shaders}/CMakeLists.txt | 0 .../cpp/viz/shaders}/test_shader_blobs.cpp | 0 .../support/layers_testing}/CMakeLists.txt | 0 .../layers_testing}/clear_rect_layer.cpp | 0 .../viz/layers/testing/clear_rect_layer.hpp | 0 .../inc/viz/layers/testing/throwing_layer.hpp | 0 .../viz/support/test_support}/CMakeLists.txt | 0 .../inc/viz/test_support/test_helpers.hpp | 0 .../cpp => tests/cpp/viz/xr}/CMakeLists.txt | 0 .../cpp/viz/xr}/test_openxr_session.cpp | 0 .../cpp/viz/xr/test_view_config_selection.cpp | 47 ++++++++++++++ .../cpp/viz/xr}/test_xr_runtime.cpp | 0 tests/python/CMakeLists.txt | 12 ++++ tests/python/core/CMakeLists.txt | 11 ++++ .../python/core/cloudxr}/CMakeLists.txt | 0 .../python/core/cloudxr}/conftest.py | 8 ++- .../python/core/cloudxr}/pyproject.toml | 0 .../python/core/cloudxr}/test_background.py | 0 .../python/core/cloudxr}/test_launcher.py | 0 .../core/cloudxr}/test_oob_teleop_adb.py | 0 .../core/cloudxr}/test_oob_teleop_env.py | 0 .../core/cloudxr}/test_oob_teleop_hub.py | 0 .../python/core/cloudxr}/test_runtime.py | 0 .../python/core/cloudxr}/test_service.py | 0 .../python/core/cloudxr}/test_service_cli.py | 0 .../python/core/cloudxr}/test_webclient.py | 0 .../core/cloudxr}/test_wss_static_client.py | 0 .../core/retargeting_engine}/CMakeLists.txt | 0 .../core/retargeting_engine/__init__.py | 4 ++ .../core/retargeting_engine}/conftest.py | 2 +- .../core/retargeting_engine}/pyproject.toml | 0 .../test_base_retargeter.py | 2 +- .../test_haptic_devices.py | 0 .../retargeting_engine}/test_haptic_sink.py | 0 .../test_joint_state_retargeter.py | 0 .../test_joint_state_source.py | 0 .../test_message_channel_nodes.py | 0 .../retargeting_engine}/test_ndarray_types.py | 2 +- .../test_parameter_state.py | 2 +- .../test_retargeter_composition.py | 2 +- .../test_retargeter_reset.py | 0 .../test_retargeter_timing.py | 2 +- .../retargeting_engine}/test_scalar_types.py | 2 +- .../test_se3_retargeter_pose_validity.py | 0 .../test_sharpa_hand_retargeter.py | 0 .../test_so101_retargeters.py | 0 .../core/retargeting_engine}/test_sources.py | 0 .../test_tactile_retargeters.py | 0 .../core/retargeting_engine}/test_tensor.py | 2 +- .../retargeting_engine}/test_tensor_group.py | 0 .../test_transform_numpy_versions.py | 0 .../retargeting_engine}/test_transforms.py | 0 .../test_tunable_parameter.py | 2 +- .../test_wuji_hand_retargeter.py | 0 .../test_wuji_mapping_tables.py | 0 .../transform_numpy_version_smoke.py | 0 .../python/core/rig}/CMakeLists.txt | 0 .../python/core/rig}/conftest.py | 8 ++- .../python/core/rig}/pyproject.toml | 0 .../python/core/rig}/test_config.py | 0 .../python/core/rig}/test_launcher.py | 0 .../python/core/rig}/test_main.py | 0 .../python/core/schema}/CMakeLists.txt | 2 +- tests/python/core/schema/__init__.py | 4 ++ .../python/core/schema}/conftest.py | 2 +- .../python/core/schema}/pyproject.toml | 0 .../python/core/schema}/test_camera.py | 0 .../python/core/schema}/test_controller.py | 0 .../python/core/schema}/test_full_body.py | 0 .../python/core/schema}/test_hand.py | 0 .../python/core/schema}/test_head.py | 0 .../python/core/schema}/test_oglo_tactile.py | 0 .../python/core/schema}/test_pedals.py | 2 +- .../python/core/schema}/test_pose.py | 2 +- .../python/core/schema}/test_se3_tracker.py | 0 .../teleop_session_manager}/CMakeLists.txt | 2 +- .../teleop_session_manager}/pyproject.toml | 0 .../test_external_oxr_handles.py | 2 +- .../test_pipeline_introspection.py | 2 +- .../test_session_reset.py | 0 .../test_teleop_session.py | 0 .../python/examples}/CMakeLists.txt | 6 +- .../examples/camera_viz}/CMakeLists.txt | 0 .../python/examples/camera_viz}/conftest.py | 10 ++- .../examples/camera_viz}/pyproject.toml | 0 .../test_paired_frame_source_race.py | 0 .../camera_viz}/test_runner_health.py | 0 .../camera_viz}/test_synthetic_offscreen.py | 2 +- .../camera_viz}/test_video_file_source.py | 0 .../python/examples/mujoco_xr}/CMakeLists.txt | 5 ++ .../python/examples/mujoco_xr}/conftest.py | 8 ++- .../python/examples/mujoco_xr}/pyproject.toml | 0 .../examples/mujoco_xr}/test_app_helpers.py | 0 .../python/examples/mujoco_xr}/test_frames.py | 0 .../python/examples/mujoco_xr}/test_ghost.py | 0 .../examples/mujoco_xr}/test_projection.py | 0 .../examples/mujoco_xr}/test_readback.py | 0 .../examples/teleop_ros2}/test_geometry.py | 0 .../examples/teleop_ros2}/test_messages.py | 0 .../teleop_ros2}/test_teleop_profiles.py | 0 tests/python/repo_paths.py | 17 +++++ .../python/viz}/CMakeLists.txt | 0 .../python/viz}/pyproject.toml | 0 .../python/viz}/test_array_interface.py | 0 .../python/viz}/test_offscreen_session.py | 0 .../python/viz}/test_projection_layer.py | 0 .../python/viz}/test_viz_import.py | 0 177 files changed, 422 insertions(+), 234 deletions(-) delete mode 100644 src/core/cloudxr_tests/CMakeLists.txt delete mode 100644 src/core/retargeting_engine_tests/CMakeLists.txt delete mode 100644 src/core/retargeting_engine_tests/python/__init__.py delete mode 100644 src/core/schema_tests/CMakeLists.txt delete mode 100644 src/core/schema_tests/python/__init__.py delete mode 100644 src/core/teleop_session_manager_tests/CMakeLists.txt delete mode 100644 src/viz/core_tests/CMakeLists.txt create mode 100644 src/viz/layers/cpp/inc/viz/layers/detail/quad_layer_eye.hpp delete mode 100644 src/viz/layers_testing/CMakeLists.txt delete mode 100644 src/viz/session_tests/CMakeLists.txt delete mode 100644 src/viz/test_support/CMakeLists.txt create mode 100644 src/viz/xr/cpp/inc/viz/xr/view_config_selection.hpp create mode 100644 src/viz/xr/cpp/view_config_selection.cpp create mode 100644 tests/AGENTS.md rename {src/core/rig_tests => tests}/CMakeLists.txt (53%) create mode 100644 tests/cpp/CMakeLists.txt rename {src/viz/layers_tests => tests/cpp/core}/CMakeLists.txt (53%) rename {src/core/live_trackers_tests/cpp => tests/cpp/core/live_trackers}/CMakeLists.txt (100%) rename {src/core/live_trackers_tests/cpp => tests/cpp/core/live_trackers}/test_vendor_validation.cpp (100%) rename {src/core/mcap_tests/cpp => tests/cpp/core/mcap}/CMakeLists.txt (77%) rename {src/core/mcap_tests/cpp => tests/cpp/core/mcap}/test_mcap_tracker_channels.cpp (100%) rename {src/core/replay_deviceio_session_tests/cpp => tests/cpp/core/replay_deviceio_session}/CMakeLists.txt (100%) rename {src/core/replay_deviceio_session_tests/cpp => tests/cpp/core/replay_deviceio_session}/test_replay_session.cpp (100%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/CMakeLists.txt (100%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/test_controller.cpp (100%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/test_full_body.cpp (99%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/test_hand.cpp (99%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/test_head.cpp (98%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/test_oak.cpp (100%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/test_pedals.cpp (100%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/test_pose.cpp (97%) rename {src/core/schema_tests/cpp => tests/cpp/core/schema}/test_se3_tracker.cpp (100%) rename {src/viz/xr_tests => tests/cpp/plugins}/CMakeLists.txt (69%) create mode 100644 tests/cpp/plugins/oglo_tactile/CMakeLists.txt rename {src/plugins/oglo_tactile/tests => tests/cpp/plugins/oglo_tactile}/test_oglo_packet_parser.cpp (100%) create mode 100644 tests/cpp/viz/CMakeLists.txt rename {src/viz/core_tests/cpp => tests/cpp/viz/core}/CMakeLists.txt (100%) rename {src/viz/core_tests/cpp => tests/cpp/viz/core}/test_device_image.cpp (100%) rename {src/viz/core_tests/cpp => tests/cpp/viz/core}/test_frame_sync.cpp (100%) rename {src/viz/core_tests/cpp => tests/cpp/viz/core}/test_host_image.cpp (100%) rename {src/viz/core_tests/cpp => tests/cpp/viz/core}/test_render_target.cpp (100%) rename {src/viz/core_tests/cpp => tests/cpp/viz/core}/test_viz_buffer.cpp (100%) rename {src/viz/core_tests/cpp => tests/cpp/viz/core}/test_viz_types.cpp (100%) rename {src/viz/core_tests/cpp => tests/cpp/viz/core}/test_vk_context.cpp (100%) rename {src/viz/layers_tests/cpp => tests/cpp/viz/layers}/CMakeLists.txt (100%) rename {src/viz/layers_tests/cpp => tests/cpp/viz/layers}/test_clear_rect_layer.cpp (100%) rename {src/viz/layers_tests/cpp => tests/cpp/viz/layers}/test_projection_layer.cpp (100%) rename {src/viz/layers_tests/cpp => tests/cpp/viz/layers}/test_quad_layer.cpp (100%) rename {src/viz/layers_tests/cpp => tests/cpp/viz/layers}/test_shaped_layers.cpp (100%) rename {src/viz/layers_tests/cpp => tests/cpp/viz/layers}/test_throwing_layer.cpp (100%) rename {src/viz/session_tests/cpp => tests/cpp/viz/session}/CMakeLists.txt (100%) rename {src/viz/session_tests/cpp => tests/cpp/viz/session}/test_offscreen_render.cpp (100%) rename {src/viz/session_tests/cpp => tests/cpp/viz/session}/test_perf_audit.cpp (100%) rename {src/viz/session_tests/cpp => tests/cpp/viz/session}/test_quad_milestone.cpp (100%) rename {src/viz/session_tests/cpp => tests/cpp/viz/session}/test_tile_layout.cpp (100%) rename {src/viz/session_tests/cpp => tests/cpp/viz/session}/test_viz_session.cpp (100%) rename {src/viz/session_tests/cpp => tests/cpp/viz/session}/test_window_primitives.cpp (100%) rename {src/viz/shaders_tests/cpp => tests/cpp/viz/shaders}/CMakeLists.txt (100%) rename {src/viz/shaders_tests/cpp => tests/cpp/viz/shaders}/test_shader_blobs.cpp (100%) rename {src/viz/layers_testing/cpp => tests/cpp/viz/support/layers_testing}/CMakeLists.txt (100%) rename {src/viz/layers_testing/cpp => tests/cpp/viz/support/layers_testing}/clear_rect_layer.cpp (100%) rename {src/viz/layers_testing/cpp => tests/cpp/viz/support/layers_testing}/inc/viz/layers/testing/clear_rect_layer.hpp (100%) rename {src/viz/layers_testing/cpp => tests/cpp/viz/support/layers_testing}/inc/viz/layers/testing/throwing_layer.hpp (100%) rename {src/viz/test_support/cpp => tests/cpp/viz/support/test_support}/CMakeLists.txt (100%) rename {src/viz/test_support/cpp => tests/cpp/viz/support/test_support}/inc/viz/test_support/test_helpers.hpp (100%) rename {src/viz/xr_tests/cpp => tests/cpp/viz/xr}/CMakeLists.txt (100%) rename {src/viz/xr_tests/cpp => tests/cpp/viz/xr}/test_openxr_session.cpp (100%) create mode 100644 tests/cpp/viz/xr/test_view_config_selection.cpp rename {src/viz/xr_tests/cpp => tests/cpp/viz/xr}/test_xr_runtime.cpp (100%) create mode 100644 tests/python/CMakeLists.txt create mode 100644 tests/python/core/CMakeLists.txt rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/CMakeLists.txt (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/conftest.py (95%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/pyproject.toml (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_background.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_launcher.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_oob_teleop_adb.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_oob_teleop_env.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_oob_teleop_hub.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_runtime.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_service.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_service_cli.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_webclient.py (100%) rename {src/core/cloudxr_tests/python => tests/python/core/cloudxr}/test_wss_static_client.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/CMakeLists.txt (100%) create mode 100644 tests/python/core/retargeting_engine/__init__.py rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/conftest.py (88%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/pyproject.toml (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_base_retargeter.py (99%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_haptic_devices.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_haptic_sink.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_joint_state_retargeter.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_joint_state_source.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_message_channel_nodes.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_ndarray_types.py (98%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_parameter_state.py (99%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_retargeter_composition.py (99%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_retargeter_reset.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_retargeter_timing.py (99%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_scalar_types.py (96%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_se3_retargeter_pose_validity.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_sharpa_hand_retargeter.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_so101_retargeters.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_sources.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_tactile_retargeters.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_tensor.py (98%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_tensor_group.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_transform_numpy_versions.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_transforms.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_tunable_parameter.py (98%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_wuji_hand_retargeter.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/test_wuji_mapping_tables.py (100%) rename {src/core/retargeting_engine_tests/python => tests/python/core/retargeting_engine}/transform_numpy_version_smoke.py (100%) rename {src/core/rig_tests/python => tests/python/core/rig}/CMakeLists.txt (100%) rename {src/core/rig_tests/python => tests/python/core/rig}/conftest.py (91%) rename {src/core/rig_tests/python => tests/python/core/rig}/pyproject.toml (100%) rename {src/core/rig_tests/python => tests/python/core/rig}/test_config.py (100%) rename {src/core/rig_tests/python => tests/python/core/rig}/test_launcher.py (100%) rename {src/core/rig_tests/python => tests/python/core/rig}/test_main.py (100%) rename {src/core/schema_tests/python => tests/python/core/schema}/CMakeLists.txt (91%) create mode 100644 tests/python/core/schema/__init__.py rename {src/core/schema_tests/python => tests/python/core/schema}/conftest.py (92%) rename {src/core/schema_tests/python => tests/python/core/schema}/pyproject.toml (100%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_camera.py (100%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_controller.py (100%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_full_body.py (100%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_hand.py (100%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_head.py (100%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_oglo_tactile.py (100%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_pedals.py (98%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_pose.py (98%) rename {src/core/schema_tests/python => tests/python/core/schema}/test_se3_tracker.py (100%) rename {src/core/teleop_session_manager_tests/python => tests/python/core/teleop_session_manager}/CMakeLists.txt (92%) rename {src/core/teleop_session_manager_tests/python => tests/python/core/teleop_session_manager}/pyproject.toml (100%) rename {src/core/teleop_session_manager_tests/python => tests/python/core/teleop_session_manager}/test_external_oxr_handles.py (98%) rename {src/core/teleop_session_manager_tests/python => tests/python/core/teleop_session_manager}/test_pipeline_introspection.py (98%) rename {src/core/teleop_session_manager_tests/python => tests/python/core/teleop_session_manager}/test_session_reset.py (100%) rename {src/core/teleop_session_manager_tests/python => tests/python/core/teleop_session_manager}/test_teleop_session.py (100%) rename {src/viz/shaders_tests => tests/python/examples}/CMakeLists.txt (63%) rename {examples/camera_viz/tests => tests/python/examples/camera_viz}/CMakeLists.txt (100%) rename {examples/camera_viz/tests => tests/python/examples/camera_viz}/conftest.py (52%) rename {examples/camera_viz/tests => tests/python/examples/camera_viz}/pyproject.toml (100%) rename {examples/camera_viz/tests => tests/python/examples/camera_viz}/test_paired_frame_source_race.py (100%) rename {examples/camera_viz/tests => tests/python/examples/camera_viz}/test_runner_health.py (100%) rename {examples/camera_viz/tests => tests/python/examples/camera_viz}/test_synthetic_offscreen.py (98%) rename {examples/camera_viz/tests => tests/python/examples/camera_viz}/test_video_file_source.py (100%) rename {examples/mujoco_xr/tests => tests/python/examples/mujoco_xr}/CMakeLists.txt (93%) rename {examples/mujoco_xr/tests => tests/python/examples/mujoco_xr}/conftest.py (70%) rename {examples/mujoco_xr/tests => tests/python/examples/mujoco_xr}/pyproject.toml (100%) rename {examples/mujoco_xr/tests => tests/python/examples/mujoco_xr}/test_app_helpers.py (100%) rename {examples/mujoco_xr/tests => tests/python/examples/mujoco_xr}/test_frames.py (100%) rename {examples/mujoco_xr/tests => tests/python/examples/mujoco_xr}/test_ghost.py (100%) rename {examples/mujoco_xr/tests => tests/python/examples/mujoco_xr}/test_projection.py (100%) rename {examples/mujoco_xr/tests => tests/python/examples/mujoco_xr}/test_readback.py (100%) rename {examples/teleop_ros2/python/tests => tests/python/examples/teleop_ros2}/test_geometry.py (100%) rename {examples/teleop_ros2/python/tests => tests/python/examples/teleop_ros2}/test_messages.py (100%) rename {examples/teleop_ros2/python/tests => tests/python/examples/teleop_ros2}/test_teleop_profiles.py (100%) create mode 100644 tests/python/repo_paths.py rename {src/viz/python_tests => tests/python/viz}/CMakeLists.txt (100%) rename {src/viz/python_tests => tests/python/viz}/pyproject.toml (100%) rename {src/viz/python_tests => tests/python/viz}/test_array_interface.py (100%) rename {src/viz/python_tests => tests/python/viz}/test_offscreen_session.py (100%) rename {src/viz/python_tests => tests/python/viz}/test_projection_layer.py (100%) rename {src/viz/python_tests => tests/python/viz}/test_viz_import.py (100%) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 945896d46..d62e4c14e 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -179,9 +179,7 @@ jobs: --gcov-exclude "${BUILD_DIR}/CMakeFiles/.*/CompilerId.*/.*" --exclude-directories "${BUILD_DIR}/CMakeFiles" --filter "src/" - --exclude "src/.*/.*_tests/.*" - --exclude "src/.*/tests/.*" - --exclude "src/.*/python_tests/.*" + --exclude "tests/.*" ) gcovr "${gcovr_args[@]}" --txt --output coverage/summary.txt --print-summary | tee coverage/totals.txt @@ -229,10 +227,10 @@ jobs: mkdir -p viz-tests-pkg # Glob all viz_*_tests executables (covers viz_core_tests today, and # viz_layers_tests / viz_session_tests / viz_xr_tests as they ship). - find "${BUILD_DIR}/src/viz" -name 'viz_*_tests' -type f -executable \ + find "${BUILD_DIR}/tests/cpp/viz" -name 'viz_*_tests' -type f -executable \ -exec cp -v {} viz-tests-pkg/ \; if ! ls viz-tests-pkg/viz_*_tests >/dev/null 2>&1; then - echo "No viz test binaries found under ${BUILD_DIR}/src/viz/" + echo "No viz test binaries found under ${BUILD_DIR}/tests/cpp/viz/" exit 1 fi tar -cvzf viz-tests.tar.gz -C viz-tests-pkg . @@ -499,7 +497,7 @@ jobs: --with pytest \ --with numpy \ --with cupy-cuda12x \ - pytest -v --tb=short src/viz/python_tests/ + pytest -v --tb=short tests/python/viz/ } if ! run_pytest; then echo "::warning::viz_python GPU tests failed on first attempt; retrying after 5s" diff --git a/CMakeLists.txt b/CMakeLists.txt index 68e263078..d16ff06da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,7 +166,6 @@ if(BUILD_EXAMPLES) add_subdirectory(examples/deviceio_live_view) add_subdirectory(examples/haptic_feedback) if(BUILD_VIZ) - add_subdirectory(examples/camera_viz/tests) add_subdirectory(examples/mujoco_xr) endif() elseif(BUILD_EXAMPLE_TELEOP_ROS2) @@ -200,6 +199,11 @@ if(BUILD_PLUGINS) endif() endif() +# Tests (pytest + Catch2/CTest). After production libs so link targets exist. +if(BUILD_TESTING) + add_subdirectory(tests) +endif() + # Formatting enforcement (runs on Linux by default) include(cmake/ClangFormat.cmake) diff --git a/cmake/cmake-structure.md b/cmake/cmake-structure.md index 9bf506cc5..b9b68c3dc 100644 --- a/cmake/cmake-structure.md +++ b/cmake/cmake-structure.md @@ -90,8 +90,10 @@ CMakeLists.txt ← top level: adds deps/ and src/ subdirectories x.cpp ← private implementation x.h ← private header z.cpp ← (see include-ordering example above) - mod1_tests/ ... ← test executable; links mod1::mod1 + deps (e.g. gtest) - mod2/ ... ← another module (one CMake target per dir) + mod1/ ... ← another module (one CMake target per dir) + tests/ ← pytest + Catch2/CTest (see tests/AGENTS.md) + cpp/ ... ← Catch2 executables; links src/ libs + deps + python/ ... ← pytest suites; one pyproject.toml per leaf ``` ## This repo's concrete conventions diff --git a/docs/source/device/haptic_feedback.rst b/docs/source/device/haptic_feedback.rst index c3edd8e69..b99818779 100644 --- a/docs/source/device/haptic_feedback.rst +++ b/docs/source/device/haptic_feedback.rst @@ -95,5 +95,5 @@ See also -------- - Example + tests: ``examples/haptic_feedback/python/`` and - ``src/core/retargeting_engine_tests/python/test_haptic_devices.py`` / + ``tests/python/core/retargeting_engine/test_haptic_devices.py`` / ``test_haptic_sink.py``. diff --git a/docs/source/device/trackers.rst b/docs/source/device/trackers.rst index ca5b9fea7..d5bfd8372 100644 --- a/docs/source/device/trackers.rst +++ b/docs/source/device/trackers.rst @@ -133,8 +133,8 @@ Tracks the HMD head pose via the OpenXR view space. - Record channels: ``head`` | MCAP schema: ``core.HeadPoseRecord`` - Tests: - - :code-file:`src/core/schema_tests/cpp/test_head.cpp` - - :code-file:`src/core/schema_tests/python/test_head.py` + - :code-file:`tests/cpp/core/schema/test_head.cpp` + - :code-file:`tests/python/core/schema/test_head.py` - Examples: @@ -153,8 +153,8 @@ Tracks articulated hand joints (26 joints per hand, following the OpenXR - Record channels: ``left_hand``, ``right_hand`` | MCAP schema: ``core.HandPoseRecord`` - Tests: - - :code-file:`src/core/schema_tests/cpp/test_hand.cpp` - - :code-file:`src/core/schema_tests/python/test_hand.py` + - :code-file:`tests/cpp/core/schema/test_hand.cpp` + - :code-file:`tests/python/core/schema/test_hand.py` - :code-file:`examples/oxr/python/test_synthetic_hands.py` - Examples: @@ -175,8 +175,8 @@ axis inputs. Uses standard OpenXR action bindings. - Record channels: ``left_controller``, ``right_controller`` | MCAP schema: ``core.ControllerSnapshotRecord`` - Tests: - - :code-file:`src/core/schema_tests/cpp/test_controller.cpp` - - :code-file:`src/core/schema_tests/python/test_controller.py` + - :code-file:`tests/cpp/core/schema/test_controller.cpp` + - :code-file:`tests/python/core/schema/test_controller.py` - :code-file:`examples/oxr/python/test_controller_tracker.py` - Examples: @@ -201,8 +201,8 @@ reads the PICO ``XR_BD_body_tracking`` extension directly. - Record channels: ``full_body`` | MCAP schema: ``core.FullBodyPoseRecord`` - Tests: - - :code-file:`src/core/schema_tests/cpp/test_full_body.cpp` - - :code-file:`src/core/schema_tests/python/test_full_body.py` + - :code-file:`tests/cpp/core/schema/test_full_body.cpp` + - :code-file:`tests/python/core/schema/test_full_body.py` - :code-file:`examples/oxr/python/test_full_body_tracker.py` - Examples: @@ -234,8 +234,8 @@ utility internally. - Record channels: ``oak``, ``oak_tracked`` | MCAP schema: ``core.FrameMetadataOakRecord`` - Tests: - - :code-file:`src/core/schema_tests/cpp/test_oak.cpp` - - :code-file:`src/core/schema_tests/python/test_camera.py` + - :code-file:`tests/cpp/core/schema/test_oak.cpp` + - :code-file:`tests/python/core/schema/test_camera.py` - :code-file:`examples/oxr/python/test_oak_camera.py` - Examples: @@ -255,8 +255,8 @@ utility internally. - Record channels: ``pedals`` | MCAP schema: ``core.Generic3AxisPedalOutputRecord`` - Tests: - - :code-file:`src/core/schema_tests/cpp/test_pedals.cpp` - - :code-file:`src/core/schema_tests/python/test_pedals.py` + - :code-file:`tests/cpp/core/schema/test_pedals.cpp` + - :code-file:`tests/python/core/schema/test_pedals.py` - Examples: diff --git a/examples/mujoco_xr/CMakeLists.txt b/examples/mujoco_xr/CMakeLists.txt index 0a74178b0..51a272a01 100644 --- a/examples/mujoco_xr/CMakeLists.txt +++ b/examples/mujoco_xr/CMakeLists.txt @@ -69,21 +69,32 @@ endif() # ImportError on the headset. MATCHALL because pyproject.toml carries the pin # twice and those must agree -- and because it would match a version written in # prose too, which is why those comments never restate the number. -set(_mujoco_pin_files "pyproject.toml" "tests/pyproject.toml") +set(_mujoco_pin_paths "${CMAKE_CURRENT_SOURCE_DIR}/pyproject.toml") +# The ctest pin lives in the repository's tests/ tree, which the standalone +# wheel configure cannot see -- and has no ctest to keep in sync either. +if(NOT _mujoco_xr_standalone) + list(APPEND _mujoco_pin_paths + "${CMAKE_SOURCE_DIR}/tests/python/examples/mujoco_xr/pyproject.toml") +endif() set(_mujoco_pins "") set(_mujoco_pin_labels "") -foreach(_pin_file IN LISTS _mujoco_pin_files) - file(READ "${CMAKE_CURRENT_SOURCE_DIR}/${_pin_file}" _pin_file_text) +foreach(_pin_path IN LISTS _mujoco_pin_paths) + if(_pin_path STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/pyproject.toml") + set(_pin_label "pyproject.toml") + else() + set(_pin_label "tests/python/examples/mujoco_xr/pyproject.toml") + endif() + file(READ "${_pin_path}" _pin_file_text) string(REGEX MATCHALL "mujoco==[0-9][0-9a-zA-Z._-]*" _pin_matches "${_pin_file_text}") if(NOT _pin_matches) - message(FATAL_ERROR "mujoco_xr: ${_pin_file} declares no `mujoco==` pin; " + message(FATAL_ERROR "mujoco_xr: ${_pin_label} declares no `mujoco==` pin; " "this file reads that pin instead of hardcoding one.") endif() foreach(_pin_match IN LISTS _pin_matches) # MATCHALL populates no CMAKE_MATCH_, so strip the fixed prefix. string(REPLACE "mujoco==" "" _pin_version "${_pin_match}") list(APPEND _mujoco_pins "${_pin_version}") - list(APPEND _mujoco_pin_labels "${_pin_file}") + list(APPEND _mujoco_pin_labels "${_pin_label}") endforeach() endforeach() list(GET _mujoco_pins 0 _mujoco_declared_pin) @@ -97,7 +108,7 @@ list(LENGTH _mujoco_distinct_pins _mujoco_distinct_pin_count) if(NOT _mujoco_distinct_pin_count EQUAL 1) message(FATAL_ERROR "mujoco_xr: the mujoco pins disagree -- pyproject.toml (both " "build-system.requires and project.dependencies) and " - "tests/pyproject.toml must all name the SAME mujoco version " + "tests/python/examples/mujoco_xr/pyproject.toml must all name the SAME mujoco version " "(exactly one libmujoco may be loaded in the process). " "Found: ${_mujoco_pins} in ${_mujoco_pin_labels}") endif() @@ -151,7 +162,7 @@ foreach(_pin_file _pin IN ZIP_LISTS _mujoco_pin_labels _mujoco_pins) "${_mujoco_version}. The C++ module and the Python app must load ONE libmujoco. Either " "install the declared pin (uv pip install --python ${Python3_EXECUTABLE} " "\"mujoco==${_pin}\") or update EVERY pin -- pyproject.toml carries it twice " - "(build-system.requires and project.dependencies) and tests/pyproject.toml once -- " + "(build-system.requires and project.dependencies) and tests/python/examples/mujoco_xr/pyproject.toml once -- " "to ${_mujoco_version}.") endif() endforeach() @@ -180,11 +191,5 @@ set(_mujoco_xr_root "${CMAKE_CURRENT_SOURCE_DIR}") add_subdirectory(cpp) -# BUILD_TESTING is undefined standalone, so ctest entries are in-tree only -- -# which is right: they need the in-place extension and the repo's isaacteleop. -if(BUILD_TESTING) - add_subdirectory(tests) -endif() - # No install() rules here, deliberately: the wheel is the only run path, and # standalone it is cpp/CMakeLists.txt's install(TARGETS) that fills it. diff --git a/examples/teleop_ros2/python/pyproject.toml b/examples/teleop_ros2/python/pyproject.toml index 9ef0cbd67..b55a6abf7 100644 --- a/examples/teleop_ros2/python/pyproject.toml +++ b/examples/teleop_ros2/python/pyproject.toml @@ -22,4 +22,4 @@ dev = [ [tool.pytest.ini_options] pythonpath = ["."] -testpaths = ["tests"] +testpaths = ["../../../tests/python/examples/teleop_ros2"] diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index da30cc497..ffa29f019 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -43,37 +43,3 @@ add_subdirectory(cloudxr) if(BUILD_PYTHON_BINDINGS) add_subdirectory(python) endif() - -# ============================================================================== -# Tests -# ============================================================================== - -if(BUILD_TESTING) - # Schema tests (C++ and Python) - add_subdirectory(schema_tests) - - # Retargeting engine tests (Python) - add_subdirectory(retargeting_engine_tests) - - # Teleop session manager tests (Python) - add_subdirectory(teleop_session_manager_tests) - - # CloudXR tests (Python — requires the built wheel from python/) - if(BUILD_PYTHON_BINDINGS) - add_subdirectory(cloudxr_tests) - endif() - - # Rig launcher tests (Python) - if(BUILD_PYTHON_BINDINGS) - add_subdirectory(rig_tests) - endif() - - # MCAP tests (C++) - add_subdirectory(mcap_tests/cpp) - - # Replay DeviceIO session tests (C++) - add_subdirectory(replay_deviceio_session_tests/cpp) - - # Live trackers tests (C++) - add_subdirectory(live_trackers_tests/cpp) -endif() diff --git a/src/core/cloudxr_tests/CMakeLists.txt b/src/core/cloudxr_tests/CMakeLists.txt deleted file mode 100644 index 004c5dd9a..000000000 --- a/src/core/cloudxr_tests/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -# ============================================================================== -# CloudXR Tests -# ============================================================================== - -# Python tests -add_subdirectory(python) diff --git a/src/core/retargeting_engine_tests/CMakeLists.txt b/src/core/retargeting_engine_tests/CMakeLists.txt deleted file mode 100644 index 3cf752f14..000000000 --- a/src/core/retargeting_engine_tests/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -# ============================================================================== -# Retargeting Engine Tests -# ============================================================================== - -# Python tests -add_subdirectory(python) diff --git a/src/core/retargeting_engine_tests/python/__init__.py b/src/core/retargeting_engine_tests/python/__init__.py deleted file mode 100644 index cc82150de..000000000 --- a/src/core/retargeting_engine_tests/python/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""Tests for retargeting_engine module.""" diff --git a/src/core/schema_tests/CMakeLists.txt b/src/core/schema_tests/CMakeLists.txt deleted file mode 100644 index 646abe64b..000000000 --- a/src/core/schema_tests/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -# ============================================================================== -# Schema Tests -# ============================================================================== - -# C++ tests (native types and schema types) -if(BUILD_TESTING) - add_subdirectory(cpp) -endif() - -# Python tests -add_subdirectory(python) diff --git a/src/core/schema_tests/python/__init__.py b/src/core/schema_tests/python/__init__.py deleted file mode 100644 index 829974bc6..000000000 --- a/src/core/schema_tests/python/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""Unit tests for isaacteleop.schema package.""" diff --git a/src/core/teleop_session_manager_tests/CMakeLists.txt b/src/core/teleop_session_manager_tests/CMakeLists.txt deleted file mode 100644 index f2caf2b00..000000000 --- a/src/core/teleop_session_manager_tests/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -# ============================================================================== -# Teleop Session Manager Tests -# ============================================================================== - -# Python tests -add_subdirectory(python) diff --git a/src/plugins/oglo_tactile/CMakeLists.txt b/src/plugins/oglo_tactile/CMakeLists.txt index db08d7b93..5dfd00cff 100644 --- a/src/plugins/oglo_tactile/CMakeLists.txt +++ b/src/plugins/oglo_tactile/CMakeLists.txt @@ -67,16 +67,3 @@ set_target_properties(oglo_tactile_plugin PROPERTIES INSTALL_RPATH "$ORIGIN") install(TARGETS oglo_tactile_plugin RUNTIME DESTINATION plugins/oglo_tactile) install(FILES plugin.yaml README.md DESTINATION plugins/oglo_tactile) - -# ------------------------------------------------------------------------------ -# Parser unit test (dependency-free; validates the packed12 v5 wire decode -# against the firmware's packing reference). -# ------------------------------------------------------------------------------ -if(BUILD_TESTING) - add_executable(test_oglo_packet_parser - tests/test_oglo_packet_parser.cpp - oglo_packet_parser.cpp - ) - target_include_directories(test_oglo_packet_parser PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - add_test(NAME oglo_packet_parser COMMAND test_oglo_packet_parser) -endif() diff --git a/src/python/isaacteleop/retargeters/SO101/clutch_retargeter.py b/src/python/isaacteleop/retargeters/SO101/clutch_retargeter.py index c0a5c68f1..2d3f30543 100644 --- a/src/python/isaacteleop/retargeters/SO101/clutch_retargeter.py +++ b/src/python/isaacteleop/retargeters/SO101/clutch_retargeter.py @@ -173,7 +173,7 @@ def _mat_to_quat_xyzw(matrix: np.ndarray) -> np.ndarray: Branch-on-trace conversions are not eyeball-verifiable, so this is pinned numerically against an independent reference over random SO(3) in - ``retargeting_engine_tests/python/test_so101_retargeters.py``. + ``tests/python/core/retargeting_engine/test_so101_retargeters.py``. """ m00, m01, m02 = matrix[0, 0], matrix[0, 1], matrix[0, 2] m10, m11, m12 = matrix[1, 0], matrix[1, 1], matrix[1, 2] diff --git a/src/viz/AGENTS.md b/src/viz/AGENTS.md index ec80d7b2b..178e89948 100644 --- a/src/viz/AGENTS.md +++ b/src/viz/AGENTS.md @@ -12,8 +12,8 @@ mandatory **`AGENTS.md` preflight** in [`../../AGENTS.md`](../../AGENTS.md) ## Package shape `src/viz/` mirrors **`src/core/`**: a peer container of sub-modules, not a -single sub-module. Each sub-module is its own static library with its own -sibling `_tests/` directory: +single sub-module. Each sub-module is its own static library. Tests live under +[`../../../tests/`](../../../tests/) — see [`tests/AGENTS.md`](../../../tests/AGENTS.md). - **`viz/core/`** — foundational types + Vulkan/CUDA infrastructure. Library: `viz_core`. Today: `VkContext`, `VizBuffer`, `Pose3D`, @@ -51,7 +51,7 @@ sibling `_tests/` directory: questions are captured under "Future: zero-copy acquire/release" in `DESIGN.md`. Test-only fixture layers (`ClearRectLayer`, `ThrowingLayer`) live in - `viz/layers_tests/cpp/inc/viz/layers/testing/` and are exposed via + `tests/cpp/viz/support/layers_testing/inc/viz/layers/testing/` and are exposed via the `viz::layers_testing` static library — used by `viz_session_tests` to compose into a `VizSession`. - **`viz/session/`** — `VizSession`, `VizCompositor`, `FrameInfo`, @@ -73,9 +73,9 @@ sibling `_tests/` directory: `viz/shaders/cpp/` and calling `compile_shader(.vert kVarName)` in the local CMakeLists. -Test directories follow the same per-module pattern: -`viz/core_tests/`, `viz/layers_tests/`, `viz/session_tests/`, -`viz/shaders_tests/`, `viz/xr_tests/`. +Catch2 and pytest suites for viz live under `tests/cpp/viz//` +and `tests/python/viz/` respectively (one Catch2 executable per sub-module: +`viz_core_tests`, `viz_layers_tests`, …). `src/viz/CMakeLists.txt` is an **orchestrator only** — it adds the sub-module sub-directories. Sub-module `CMakeLists.txt` files build the @@ -162,17 +162,16 @@ Beyond happy-path coverage, every new feature MUST add tests for: ### Test fixtures Test-only `LayerBase` subclasses and helpers live in -`viz/layers_tests/cpp/inc/viz/layers/testing/` and ship via the +`tests/cpp/viz/support/layers_testing/inc/viz/layers/testing/` and ship via the `viz::layers_testing` static library. Other test executables link that library to compose fixtures. Today: - `ClearRectLayer` — paints a rect via `vkCmdClearAttachments` (no shaders); used to verify compositor dispatch produces real pixels. - `ThrowingLayer` — throws from `record()` on a configurable schedule; used for exception-recovery tests. -- Test files live alongside the code they test, in - `_tests/cpp/`. One executable per sub-module - (`viz_core_tests`, `viz_layers_tests`, ...). Do **not** dump tests - into a top-level `viz_tests/` directory. +- Catch2 sources live under `tests/cpp/viz//`. One executable + per sub-module (`viz_core_tests`, `viz_layers_tests`, …). Do **not** + collapse viz tests into a single mega-target. ## CI coverage diff --git a/src/viz/CMakeLists.txt b/src/viz/CMakeLists.txt index 54eec2201..4ec0006e9 100644 --- a/src/viz/CMakeLists.txt +++ b/src/viz/CMakeLists.txt @@ -8,8 +8,8 @@ cmake_minimum_required(VERSION 3.20) # ============================================================================== # # Televiz mirrors the structure of src/core: a container of sub-modules, each -# with its own static library and (when needed) a sibling _tests/ -# directory. +# with its own static library. Tests live under tests/cpp/viz/ and +# tests/python/viz/ (see tests/AGENTS.md). # # Sub-modules (planned): # core — Vulkan + CUDA infrastructure, foundational types @@ -51,20 +51,3 @@ add_subdirectory(layers) if(BUILD_PYTHON_BINDINGS) add_subdirectory(python) endif() - -# Tests for each sub-module live in _tests/ siblings. Shared test -# fixtures are their own one-target leaf modules, processed first so the -# *_tests executables can resolve their aliases at the link call. -if(BUILD_TESTING) - add_subdirectory(test_support) - add_subdirectory(layers_testing) - - add_subdirectory(core_tests) - add_subdirectory(layers_tests) - add_subdirectory(session_tests) - add_subdirectory(shaders_tests) - add_subdirectory(xr_tests) - if(BUILD_PYTHON_BINDINGS) - add_subdirectory(python_tests) - endif() -endif() diff --git a/src/viz/core_tests/CMakeLists.txt b/src/viz/core_tests/CMakeLists.txt deleted file mode 100644 index e954c024a..000000000 --- a/src/viz/core_tests/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20) - -# Tests for viz/core/. Python tests will be added with the bindings. -add_subdirectory(cpp) diff --git a/src/viz/layers/cpp/CMakeLists.txt b/src/viz/layers/cpp/CMakeLists.txt index 5f9e5d916..fa2c0656b 100644 --- a/src/viz/layers/cpp/CMakeLists.txt +++ b/src/viz/layers/cpp/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.20) # session's contract for what a layer is — lives in viz::session, not # here, so we depend on viz::session for the base class. Test-only # helper layers (ClearRectLayer, ThrowingLayer) live in -# viz/layers_tests/. +# tests/cpp/viz/support/layers_testing/. add_library(viz_layers STATIC image_layer_base.cpp quad_layer.cpp diff --git a/src/viz/layers/cpp/inc/viz/layers/detail/quad_layer_eye.hpp b/src/viz/layers/cpp/inc/viz/layers/detail/quad_layer_eye.hpp new file mode 100644 index 000000000..764dac1ee --- /dev/null +++ b/src/viz/layers/cpp/inc/viz/layers/detail/quad_layer_eye.hpp @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +#pragma once + +#include + +namespace viz::detail +{ + +// Eye-driven stereo sampling for composited QuadLayer record(). View index +// is not an eye id in quad-view (insets are views 2/3). +inline bool quad_layer_sample_right(bool xr_mode, bool stereo, Eye eye) noexcept +{ + return xr_mode && stereo && eye == Eye::kRight; +} + +inline float quad_layer_baseline_sign(Eye eye) noexcept +{ + return (eye == Eye::kRight) ? +1.0f : -1.0f; +} + +} // namespace viz::detail diff --git a/src/viz/layers_testing/CMakeLists.txt b/src/viz/layers_testing/CMakeLists.txt deleted file mode 100644 index d175214ae..000000000 --- a/src/viz/layers_testing/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20) - -# Test-only layer fixtures (viz::layers_testing). Built under BUILD_TESTING. -add_subdirectory(cpp) diff --git a/src/viz/session_tests/CMakeLists.txt b/src/viz/session_tests/CMakeLists.txt deleted file mode 100644 index a25478921..000000000 --- a/src/viz/session_tests/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20) - -# Build C++ tests -add_subdirectory(cpp) diff --git a/src/viz/test_support/CMakeLists.txt b/src/viz/test_support/CMakeLists.txt deleted file mode 100644 index 55419e5a0..000000000 --- a/src/viz/test_support/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20) - -# Shared test-support INTERFACE library (test_helpers.hpp) consumed by all -# viz_*_tests. Test-only; built under BUILD_TESTING. -add_subdirectory(cpp) diff --git a/src/viz/xr/cpp/inc/viz/xr/view_config_selection.hpp b/src/viz/xr/cpp/inc/viz/xr/view_config_selection.hpp new file mode 100644 index 000000000..82a52a83b --- /dev/null +++ b/src/viz/xr/cpp/inc/viz/xr/view_config_selection.hpp @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +#pragma once + +#include + +#include +#include + +namespace viz::detail +{ + +// Human-readable name for logging / error messages. +const char* view_configuration_type_name(XrViewConfigurationType type) noexcept; + +// Pick the primary view configuration from what the runtime advertises. +// When prefer_foveated_inset is true, prefers PRIMARY_STEREO_WITH_FOVEATED_INSET, +// then PRIMARY_STEREO, then the first entry. Throws if advertised is empty. +XrViewConfigurationType select_view_configuration(const std::vector& advertised, + bool prefer_foveated_inset); + +} // namespace viz::detail diff --git a/src/viz/xr/cpp/view_config_selection.cpp b/src/viz/xr/cpp/view_config_selection.cpp new file mode 100644 index 000000000..fdca79997 --- /dev/null +++ b/src/viz/xr/cpp/view_config_selection.cpp @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +#include "inc/viz/xr/view_config_selection.hpp" + +#include +#include + +namespace viz::detail +{ + +const char* view_configuration_type_name(XrViewConfigurationType type) noexcept +{ + switch (type) + { + case XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO: + return "PRIMARY_MONO"; + case XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO: + return "PRIMARY_STEREO"; + case XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO_WITH_FOVEATED_INSET: + return "PRIMARY_STEREO_WITH_FOVEATED_INSET"; + default: + return "UNKNOWN"; + } +} + +XrViewConfigurationType select_view_configuration(const std::vector& advertised, + bool prefer_foveated_inset) +{ + if (advertised.empty()) + { + throw std::runtime_error("OpenXrSession: runtime advertises zero view configurations"); + } + + const auto has = [&](XrViewConfigurationType t) + { return std::find(advertised.begin(), advertised.end(), t) != advertised.end(); }; + + if (prefer_foveated_inset && has(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO_WITH_FOVEATED_INSET)) + { + return XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO_WITH_FOVEATED_INSET; + } + if (has(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO)) + { + return XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO; + } + return advertised.front(); +} + +} // namespace viz::detail diff --git a/tests/AGENTS.md b/tests/AGENTS.md new file mode 100644 index 000000000..c51091d13 --- /dev/null +++ b/tests/AGENTS.md @@ -0,0 +1,65 @@ + + +# Agent notes — `tests/` + +**CRITICAL:** Complete the mandatory **`AGENTS.md` preflight** in +[`../AGENTS.md`](../AGENTS.md) before editing here. + +## Layout + +All pytest and Catch2/CTest suites live under this tree: + +```text +tests/ + cpp/ ← Catch2 executables (one target per module leaf) + python/ ← pytest suites (one pyproject.toml per leaf) +``` + +Organize by **product area**, mirroring `src/` and `examples/`: + +| Area | C++ path | Python path | +|------|----------|-------------| +| core | `tests/cpp/core//` | `tests/python/core//` | +| viz | `tests/cpp/viz//` | `tests/python/viz/` | +| plugins | `tests/cpp/plugins//` | — | +| examples | — | `tests/python/examples//` | + +Shared C++ fixtures (not executables) live under `tests/cpp/viz/support/` +(`viz::test_support`, `viz::layers_testing`). + +## Naming invariants (CI depends on these) + +- **Catch2 executable names** stay stable: `schema_tests`, `viz_core_tests`, + `viz_layers_tests`, … CI globs `viz_*_tests` for GPU packaging. +- **CTest name prefixes** stay stable: `schema_*`, `retargeting_*`, + `viz_python_*`, `mujoco_xr_*`, etc. +- **Catch2 tags** → CTest labels via `ADD_TAGS_AS_LABELS` (`unit`, `gpu`, `xr`). + +## Python conventions + +- Each leaf directory has its own `pyproject.toml` so `uv run` resolves deps + locally (mujoco pins, asyncio, cupy extras, grounding/wuji extras). +- CTest runs one `pytest` invocation per `test_*.py` with `WORKING_DIRECTORY` + set to that leaf. +- Use [`repo_paths.py`](python/repo_paths.py) for paths into `src/python/` or + `examples/` from `conftest.py` — do not hard-code `parents[N]` against repo depth. +- If CMake under `examples/` reads a file under `tests/`, guard it on the + in-tree configure: standalone wheel builds use the example as `CMAKE_SOURCE_DIR`, + not the repo root. + +## Adding tests + +1. Pick the matching `tests/{cpp,python}///` leaf (create it if new). +2. Add sources + leaf `CMakeLists.txt` (copy an existing sibling). +3. Wire the leaf from the parent `CMakeLists.txt` under the same `BUILD_*` gates + as before (e.g. viz tests require `BUILD_VIZ`). +4. Do **not** colocate new pytest/Catch2 trees under `src/` or `examples/`. + +## Out of scope here + +- `src/core/codegen/test_*.py` — unittest, co-located with the generator. +- `examples/oxr/python/test_*.py` — standalone scripts for CloudXR GPU CI. +- ROS2 Docker integration helpers under `examples/teleop_ros2/.../integration_tests/`. diff --git a/src/core/rig_tests/CMakeLists.txt b/tests/CMakeLists.txt similarity index 53% rename from src/core/rig_tests/CMakeLists.txt rename to tests/CMakeLists.txt index cbe9f2948..59e4ea5dc 100644 --- a/src/core/rig_tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,8 +2,13 @@ # SPDX-License-Identifier: Apache-2.0 # ============================================================================== -# Rig Launcher Tests +# IsaacTeleop tests (pytest + Catch2/CTest) # ============================================================================== +# +# Production libraries live under src/ and examples/; all pytest and Catch2 +# suites live here under tests/python/ and tests/cpp/. -# Python tests -add_subdirectory(python) +if(BUILD_TESTING) + add_subdirectory(cpp) + add_subdirectory(python) +endif() diff --git a/tests/cpp/CMakeLists.txt b/tests/cpp/CMakeLists.txt new file mode 100644 index 000000000..78fde6b35 --- /dev/null +++ b/tests/cpp/CMakeLists.txt @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(core) + +if(BUILD_VIZ) + add_subdirectory(viz) +endif() + +if(BUILD_PLUGINS AND BUILD_PLUGIN_OGLO) + add_subdirectory(plugins) +endif() diff --git a/src/viz/layers_tests/CMakeLists.txt b/tests/cpp/core/CMakeLists.txt similarity index 53% rename from src/viz/layers_tests/CMakeLists.txt rename to tests/cpp/core/CMakeLists.txt index 8d1dd6968..79c958f89 100644 --- a/src/viz/layers_tests/CMakeLists.txt +++ b/tests/cpp/core/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.20) - -# Build C++ test fixtures + tests -add_subdirectory(cpp) +add_subdirectory(schema) +add_subdirectory(mcap) +add_subdirectory(replay_deviceio_session) +add_subdirectory(live_trackers) diff --git a/src/core/live_trackers_tests/cpp/CMakeLists.txt b/tests/cpp/core/live_trackers/CMakeLists.txt similarity index 100% rename from src/core/live_trackers_tests/cpp/CMakeLists.txt rename to tests/cpp/core/live_trackers/CMakeLists.txt diff --git a/src/core/live_trackers_tests/cpp/test_vendor_validation.cpp b/tests/cpp/core/live_trackers/test_vendor_validation.cpp similarity index 100% rename from src/core/live_trackers_tests/cpp/test_vendor_validation.cpp rename to tests/cpp/core/live_trackers/test_vendor_validation.cpp diff --git a/src/core/mcap_tests/cpp/CMakeLists.txt b/tests/cpp/core/mcap/CMakeLists.txt similarity index 77% rename from src/core/mcap_tests/cpp/CMakeLists.txt rename to tests/cpp/core/mcap/CMakeLists.txt index 65205fdd3..344f5e78d 100644 --- a/src/core/mcap_tests/cpp/CMakeLists.txt +++ b/tests/cpp/core/mcap/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 cmake_minimum_required(VERSION 3.20) diff --git a/src/core/mcap_tests/cpp/test_mcap_tracker_channels.cpp b/tests/cpp/core/mcap/test_mcap_tracker_channels.cpp similarity index 100% rename from src/core/mcap_tests/cpp/test_mcap_tracker_channels.cpp rename to tests/cpp/core/mcap/test_mcap_tracker_channels.cpp diff --git a/src/core/replay_deviceio_session_tests/cpp/CMakeLists.txt b/tests/cpp/core/replay_deviceio_session/CMakeLists.txt similarity index 100% rename from src/core/replay_deviceio_session_tests/cpp/CMakeLists.txt rename to tests/cpp/core/replay_deviceio_session/CMakeLists.txt diff --git a/src/core/replay_deviceio_session_tests/cpp/test_replay_session.cpp b/tests/cpp/core/replay_deviceio_session/test_replay_session.cpp similarity index 100% rename from src/core/replay_deviceio_session_tests/cpp/test_replay_session.cpp rename to tests/cpp/core/replay_deviceio_session/test_replay_session.cpp diff --git a/src/core/schema_tests/cpp/CMakeLists.txt b/tests/cpp/core/schema/CMakeLists.txt similarity index 100% rename from src/core/schema_tests/cpp/CMakeLists.txt rename to tests/cpp/core/schema/CMakeLists.txt diff --git a/src/core/schema_tests/cpp/test_controller.cpp b/tests/cpp/core/schema/test_controller.cpp similarity index 100% rename from src/core/schema_tests/cpp/test_controller.cpp rename to tests/cpp/core/schema/test_controller.cpp diff --git a/src/core/schema_tests/cpp/test_full_body.cpp b/tests/cpp/core/schema/test_full_body.cpp similarity index 99% rename from src/core/schema_tests/cpp/test_full_body.cpp rename to tests/cpp/core/schema/test_full_body.cpp index 33cebec4b..79acbe6a7 100644 --- a/src/core/schema_tests/cpp/test_full_body.cpp +++ b/tests/cpp/core/schema/test_full_body.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 // Unit tests for the generated FullBodyPose FlatBuffer message. diff --git a/src/core/schema_tests/cpp/test_hand.cpp b/tests/cpp/core/schema/test_hand.cpp similarity index 99% rename from src/core/schema_tests/cpp/test_hand.cpp rename to tests/cpp/core/schema/test_hand.cpp index 8eace29b2..51d33fa91 100644 --- a/src/core/schema_tests/cpp/test_hand.cpp +++ b/tests/cpp/core/schema/test_hand.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 // Unit tests for the generated HandPose FlatBuffer message. diff --git a/src/core/schema_tests/cpp/test_head.cpp b/tests/cpp/core/schema/test_head.cpp similarity index 98% rename from src/core/schema_tests/cpp/test_head.cpp rename to tests/cpp/core/schema/test_head.cpp index d669f1c52..123be52ad 100644 --- a/src/core/schema_tests/cpp/test_head.cpp +++ b/tests/cpp/core/schema/test_head.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 // Unit tests for the generated HeadPose FlatBuffer message. diff --git a/src/core/schema_tests/cpp/test_oak.cpp b/tests/cpp/core/schema/test_oak.cpp similarity index 100% rename from src/core/schema_tests/cpp/test_oak.cpp rename to tests/cpp/core/schema/test_oak.cpp diff --git a/src/core/schema_tests/cpp/test_pedals.cpp b/tests/cpp/core/schema/test_pedals.cpp similarity index 100% rename from src/core/schema_tests/cpp/test_pedals.cpp rename to tests/cpp/core/schema/test_pedals.cpp diff --git a/src/core/schema_tests/cpp/test_pose.cpp b/tests/cpp/core/schema/test_pose.cpp similarity index 97% rename from src/core/schema_tests/cpp/test_pose.cpp rename to tests/cpp/core/schema/test_pose.cpp index ae28ac9eb..aaaea6691 100644 --- a/src/core/schema_tests/cpp/test_pose.cpp +++ b/tests/cpp/core/schema/test_pose.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 // Unit tests for the generated Pose FlatBuffer struct. diff --git a/src/core/schema_tests/cpp/test_se3_tracker.cpp b/tests/cpp/core/schema/test_se3_tracker.cpp similarity index 100% rename from src/core/schema_tests/cpp/test_se3_tracker.cpp rename to tests/cpp/core/schema/test_se3_tracker.cpp diff --git a/src/viz/xr_tests/CMakeLists.txt b/tests/cpp/plugins/CMakeLists.txt similarity index 69% rename from src/viz/xr_tests/CMakeLists.txt rename to tests/cpp/plugins/CMakeLists.txt index 8ce91de36..49e3463a3 100644 --- a/src/viz/xr_tests/CMakeLists.txt +++ b/tests/cpp/plugins/CMakeLists.txt @@ -1,6 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.20) - -add_subdirectory(cpp) +add_subdirectory(oglo_tactile) diff --git a/tests/cpp/plugins/oglo_tactile/CMakeLists.txt b/tests/cpp/plugins/oglo_tactile/CMakeLists.txt new file mode 100644 index 000000000..4ae2e5699 --- /dev/null +++ b/tests/cpp/plugins/oglo_tactile/CMakeLists.txt @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Parser unit test (dependency-free; validates the packed12 v5 wire decode +# against the firmware's packing reference). +add_executable(test_oglo_packet_parser + test_oglo_packet_parser.cpp + ${CMAKE_SOURCE_DIR}/src/plugins/oglo_tactile/oglo_packet_parser.cpp +) +target_include_directories(test_oglo_packet_parser PRIVATE + ${CMAKE_SOURCE_DIR}/src/plugins/oglo_tactile +) +add_test(NAME oglo_packet_parser COMMAND test_oglo_packet_parser) diff --git a/src/plugins/oglo_tactile/tests/test_oglo_packet_parser.cpp b/tests/cpp/plugins/oglo_tactile/test_oglo_packet_parser.cpp similarity index 100% rename from src/plugins/oglo_tactile/tests/test_oglo_packet_parser.cpp rename to tests/cpp/plugins/oglo_tactile/test_oglo_packet_parser.cpp diff --git a/tests/cpp/viz/CMakeLists.txt b/tests/cpp/viz/CMakeLists.txt new file mode 100644 index 000000000..ac0cd4ea8 --- /dev/null +++ b/tests/cpp/viz/CMakeLists.txt @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Shared fixtures first so *_tests executables resolve aliases at link time. +add_subdirectory(support/test_support) +add_subdirectory(support/layers_testing) + +add_subdirectory(core) +add_subdirectory(layers) +add_subdirectory(session) +add_subdirectory(shaders) +add_subdirectory(xr) diff --git a/src/viz/core_tests/cpp/CMakeLists.txt b/tests/cpp/viz/core/CMakeLists.txt similarity index 100% rename from src/viz/core_tests/cpp/CMakeLists.txt rename to tests/cpp/viz/core/CMakeLists.txt diff --git a/src/viz/core_tests/cpp/test_device_image.cpp b/tests/cpp/viz/core/test_device_image.cpp similarity index 100% rename from src/viz/core_tests/cpp/test_device_image.cpp rename to tests/cpp/viz/core/test_device_image.cpp diff --git a/src/viz/core_tests/cpp/test_frame_sync.cpp b/tests/cpp/viz/core/test_frame_sync.cpp similarity index 100% rename from src/viz/core_tests/cpp/test_frame_sync.cpp rename to tests/cpp/viz/core/test_frame_sync.cpp diff --git a/src/viz/core_tests/cpp/test_host_image.cpp b/tests/cpp/viz/core/test_host_image.cpp similarity index 100% rename from src/viz/core_tests/cpp/test_host_image.cpp rename to tests/cpp/viz/core/test_host_image.cpp diff --git a/src/viz/core_tests/cpp/test_render_target.cpp b/tests/cpp/viz/core/test_render_target.cpp similarity index 100% rename from src/viz/core_tests/cpp/test_render_target.cpp rename to tests/cpp/viz/core/test_render_target.cpp diff --git a/src/viz/core_tests/cpp/test_viz_buffer.cpp b/tests/cpp/viz/core/test_viz_buffer.cpp similarity index 100% rename from src/viz/core_tests/cpp/test_viz_buffer.cpp rename to tests/cpp/viz/core/test_viz_buffer.cpp diff --git a/src/viz/core_tests/cpp/test_viz_types.cpp b/tests/cpp/viz/core/test_viz_types.cpp similarity index 100% rename from src/viz/core_tests/cpp/test_viz_types.cpp rename to tests/cpp/viz/core/test_viz_types.cpp diff --git a/src/viz/core_tests/cpp/test_vk_context.cpp b/tests/cpp/viz/core/test_vk_context.cpp similarity index 100% rename from src/viz/core_tests/cpp/test_vk_context.cpp rename to tests/cpp/viz/core/test_vk_context.cpp diff --git a/src/viz/layers_tests/cpp/CMakeLists.txt b/tests/cpp/viz/layers/CMakeLists.txt similarity index 100% rename from src/viz/layers_tests/cpp/CMakeLists.txt rename to tests/cpp/viz/layers/CMakeLists.txt diff --git a/src/viz/layers_tests/cpp/test_clear_rect_layer.cpp b/tests/cpp/viz/layers/test_clear_rect_layer.cpp similarity index 100% rename from src/viz/layers_tests/cpp/test_clear_rect_layer.cpp rename to tests/cpp/viz/layers/test_clear_rect_layer.cpp diff --git a/src/viz/layers_tests/cpp/test_projection_layer.cpp b/tests/cpp/viz/layers/test_projection_layer.cpp similarity index 100% rename from src/viz/layers_tests/cpp/test_projection_layer.cpp rename to tests/cpp/viz/layers/test_projection_layer.cpp diff --git a/src/viz/layers_tests/cpp/test_quad_layer.cpp b/tests/cpp/viz/layers/test_quad_layer.cpp similarity index 100% rename from src/viz/layers_tests/cpp/test_quad_layer.cpp rename to tests/cpp/viz/layers/test_quad_layer.cpp diff --git a/src/viz/layers_tests/cpp/test_shaped_layers.cpp b/tests/cpp/viz/layers/test_shaped_layers.cpp similarity index 100% rename from src/viz/layers_tests/cpp/test_shaped_layers.cpp rename to tests/cpp/viz/layers/test_shaped_layers.cpp diff --git a/src/viz/layers_tests/cpp/test_throwing_layer.cpp b/tests/cpp/viz/layers/test_throwing_layer.cpp similarity index 100% rename from src/viz/layers_tests/cpp/test_throwing_layer.cpp rename to tests/cpp/viz/layers/test_throwing_layer.cpp diff --git a/src/viz/session_tests/cpp/CMakeLists.txt b/tests/cpp/viz/session/CMakeLists.txt similarity index 100% rename from src/viz/session_tests/cpp/CMakeLists.txt rename to tests/cpp/viz/session/CMakeLists.txt diff --git a/src/viz/session_tests/cpp/test_offscreen_render.cpp b/tests/cpp/viz/session/test_offscreen_render.cpp similarity index 100% rename from src/viz/session_tests/cpp/test_offscreen_render.cpp rename to tests/cpp/viz/session/test_offscreen_render.cpp diff --git a/src/viz/session_tests/cpp/test_perf_audit.cpp b/tests/cpp/viz/session/test_perf_audit.cpp similarity index 100% rename from src/viz/session_tests/cpp/test_perf_audit.cpp rename to tests/cpp/viz/session/test_perf_audit.cpp diff --git a/src/viz/session_tests/cpp/test_quad_milestone.cpp b/tests/cpp/viz/session/test_quad_milestone.cpp similarity index 100% rename from src/viz/session_tests/cpp/test_quad_milestone.cpp rename to tests/cpp/viz/session/test_quad_milestone.cpp diff --git a/src/viz/session_tests/cpp/test_tile_layout.cpp b/tests/cpp/viz/session/test_tile_layout.cpp similarity index 100% rename from src/viz/session_tests/cpp/test_tile_layout.cpp rename to tests/cpp/viz/session/test_tile_layout.cpp diff --git a/src/viz/session_tests/cpp/test_viz_session.cpp b/tests/cpp/viz/session/test_viz_session.cpp similarity index 100% rename from src/viz/session_tests/cpp/test_viz_session.cpp rename to tests/cpp/viz/session/test_viz_session.cpp diff --git a/src/viz/session_tests/cpp/test_window_primitives.cpp b/tests/cpp/viz/session/test_window_primitives.cpp similarity index 100% rename from src/viz/session_tests/cpp/test_window_primitives.cpp rename to tests/cpp/viz/session/test_window_primitives.cpp diff --git a/src/viz/shaders_tests/cpp/CMakeLists.txt b/tests/cpp/viz/shaders/CMakeLists.txt similarity index 100% rename from src/viz/shaders_tests/cpp/CMakeLists.txt rename to tests/cpp/viz/shaders/CMakeLists.txt diff --git a/src/viz/shaders_tests/cpp/test_shader_blobs.cpp b/tests/cpp/viz/shaders/test_shader_blobs.cpp similarity index 100% rename from src/viz/shaders_tests/cpp/test_shader_blobs.cpp rename to tests/cpp/viz/shaders/test_shader_blobs.cpp diff --git a/src/viz/layers_testing/cpp/CMakeLists.txt b/tests/cpp/viz/support/layers_testing/CMakeLists.txt similarity index 100% rename from src/viz/layers_testing/cpp/CMakeLists.txt rename to tests/cpp/viz/support/layers_testing/CMakeLists.txt diff --git a/src/viz/layers_testing/cpp/clear_rect_layer.cpp b/tests/cpp/viz/support/layers_testing/clear_rect_layer.cpp similarity index 100% rename from src/viz/layers_testing/cpp/clear_rect_layer.cpp rename to tests/cpp/viz/support/layers_testing/clear_rect_layer.cpp diff --git a/src/viz/layers_testing/cpp/inc/viz/layers/testing/clear_rect_layer.hpp b/tests/cpp/viz/support/layers_testing/inc/viz/layers/testing/clear_rect_layer.hpp similarity index 100% rename from src/viz/layers_testing/cpp/inc/viz/layers/testing/clear_rect_layer.hpp rename to tests/cpp/viz/support/layers_testing/inc/viz/layers/testing/clear_rect_layer.hpp diff --git a/src/viz/layers_testing/cpp/inc/viz/layers/testing/throwing_layer.hpp b/tests/cpp/viz/support/layers_testing/inc/viz/layers/testing/throwing_layer.hpp similarity index 100% rename from src/viz/layers_testing/cpp/inc/viz/layers/testing/throwing_layer.hpp rename to tests/cpp/viz/support/layers_testing/inc/viz/layers/testing/throwing_layer.hpp diff --git a/src/viz/test_support/cpp/CMakeLists.txt b/tests/cpp/viz/support/test_support/CMakeLists.txt similarity index 100% rename from src/viz/test_support/cpp/CMakeLists.txt rename to tests/cpp/viz/support/test_support/CMakeLists.txt diff --git a/src/viz/test_support/cpp/inc/viz/test_support/test_helpers.hpp b/tests/cpp/viz/support/test_support/inc/viz/test_support/test_helpers.hpp similarity index 100% rename from src/viz/test_support/cpp/inc/viz/test_support/test_helpers.hpp rename to tests/cpp/viz/support/test_support/inc/viz/test_support/test_helpers.hpp diff --git a/src/viz/xr_tests/cpp/CMakeLists.txt b/tests/cpp/viz/xr/CMakeLists.txt similarity index 100% rename from src/viz/xr_tests/cpp/CMakeLists.txt rename to tests/cpp/viz/xr/CMakeLists.txt diff --git a/src/viz/xr_tests/cpp/test_openxr_session.cpp b/tests/cpp/viz/xr/test_openxr_session.cpp similarity index 100% rename from src/viz/xr_tests/cpp/test_openxr_session.cpp rename to tests/cpp/viz/xr/test_openxr_session.cpp diff --git a/tests/cpp/viz/xr/test_view_config_selection.cpp b/tests/cpp/viz/xr/test_view_config_selection.cpp new file mode 100644 index 000000000..80ed62197 --- /dev/null +++ b/tests/cpp/viz/xr/test_view_config_selection.cpp @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +#include +#include +#include + +#include + +TEST_CASE("select_view_configuration prefers foveated inset when advertised", "[unit][view_config]") +{ + const std::vector advertised = { + XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, + XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO_WITH_FOVEATED_INSET, + }; + const auto selected = viz::detail::select_view_configuration(advertised, true); + CHECK(selected == XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO_WITH_FOVEATED_INSET); +} + +TEST_CASE("select_view_configuration falls back to stereo", "[unit][view_config]") +{ + const std::vector advertised = { XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO }; + const auto selected = viz::detail::select_view_configuration(advertised, true); + CHECK(selected == XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO); +} + +TEST_CASE("select_view_configuration honors prefer_foveated_inset=false", "[unit][view_config]") +{ + const std::vector advertised = { + XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, + XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO_WITH_FOVEATED_INSET, + }; + const auto selected = viz::detail::select_view_configuration(advertised, false); + CHECK(selected == XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO); +} + +TEST_CASE("select_view_configuration uses first when neither primary advertised", "[unit][view_config]") +{ + const std::vector advertised = { XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO }; + const auto selected = viz::detail::select_view_configuration(advertised, true); + CHECK(selected == XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO); +} + +TEST_CASE("select_view_configuration rejects empty advertised list", "[unit][view_config]") +{ + CHECK_THROWS(viz::detail::select_view_configuration({}, true)); +} diff --git a/src/viz/xr_tests/cpp/test_xr_runtime.cpp b/tests/cpp/viz/xr/test_xr_runtime.cpp similarity index 100% rename from src/viz/xr_tests/cpp/test_xr_runtime.cpp rename to tests/cpp/viz/xr/test_xr_runtime.cpp diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt new file mode 100644 index 000000000..4dd71f385 --- /dev/null +++ b/tests/python/CMakeLists.txt @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(core) + +if(BUILD_VIZ AND BUILD_PYTHON_BINDINGS) + add_subdirectory(viz) +endif() + +if(BUILD_EXAMPLES AND BUILD_VIZ) + add_subdirectory(examples) +endif() diff --git a/tests/python/core/CMakeLists.txt b/tests/python/core/CMakeLists.txt new file mode 100644 index 000000000..eb680148f --- /dev/null +++ b/tests/python/core/CMakeLists.txt @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(schema) +add_subdirectory(retargeting_engine) +add_subdirectory(teleop_session_manager) + +if(BUILD_PYTHON_BINDINGS) + add_subdirectory(cloudxr) + add_subdirectory(rig) +endif() diff --git a/src/core/cloudxr_tests/python/CMakeLists.txt b/tests/python/core/cloudxr/CMakeLists.txt similarity index 100% rename from src/core/cloudxr_tests/python/CMakeLists.txt rename to tests/python/core/cloudxr/CMakeLists.txt diff --git a/src/core/cloudxr_tests/python/conftest.py b/tests/python/core/cloudxr/conftest.py similarity index 95% rename from src/core/cloudxr_tests/python/conftest.py rename to tests/python/core/cloudxr/conftest.py index 0ea0288f1..cbd70f95e 100644 --- a/src/core/cloudxr_tests/python/conftest.py +++ b/tests/python/core/cloudxr/conftest.py @@ -20,7 +20,13 @@ from pathlib import Path from unittest.mock import MagicMock, patch -_CLOUDXR_PY = Path(__file__).resolve().parents[3] / "python" / "isaacteleop" / "cloudxr" +_tests_python = Path(__file__).resolve().parents[2] +if str(_tests_python) not in sys.path: + sys.path.insert(0, str(_tests_python)) + +from repo_paths import repo_root # noqa: E402 + +_CLOUDXR_PY = repo_root() / "src" / "python" / "isaacteleop" / "cloudxr" if _CLOUDXR_PY.is_dir() and str(_CLOUDXR_PY) not in sys.path: sys.path.insert(0, str(_CLOUDXR_PY)) diff --git a/src/core/cloudxr_tests/python/pyproject.toml b/tests/python/core/cloudxr/pyproject.toml similarity index 100% rename from src/core/cloudxr_tests/python/pyproject.toml rename to tests/python/core/cloudxr/pyproject.toml diff --git a/src/core/cloudxr_tests/python/test_background.py b/tests/python/core/cloudxr/test_background.py similarity index 100% rename from src/core/cloudxr_tests/python/test_background.py rename to tests/python/core/cloudxr/test_background.py diff --git a/src/core/cloudxr_tests/python/test_launcher.py b/tests/python/core/cloudxr/test_launcher.py similarity index 100% rename from src/core/cloudxr_tests/python/test_launcher.py rename to tests/python/core/cloudxr/test_launcher.py diff --git a/src/core/cloudxr_tests/python/test_oob_teleop_adb.py b/tests/python/core/cloudxr/test_oob_teleop_adb.py similarity index 100% rename from src/core/cloudxr_tests/python/test_oob_teleop_adb.py rename to tests/python/core/cloudxr/test_oob_teleop_adb.py diff --git a/src/core/cloudxr_tests/python/test_oob_teleop_env.py b/tests/python/core/cloudxr/test_oob_teleop_env.py similarity index 100% rename from src/core/cloudxr_tests/python/test_oob_teleop_env.py rename to tests/python/core/cloudxr/test_oob_teleop_env.py diff --git a/src/core/cloudxr_tests/python/test_oob_teleop_hub.py b/tests/python/core/cloudxr/test_oob_teleop_hub.py similarity index 100% rename from src/core/cloudxr_tests/python/test_oob_teleop_hub.py rename to tests/python/core/cloudxr/test_oob_teleop_hub.py diff --git a/src/core/cloudxr_tests/python/test_runtime.py b/tests/python/core/cloudxr/test_runtime.py similarity index 100% rename from src/core/cloudxr_tests/python/test_runtime.py rename to tests/python/core/cloudxr/test_runtime.py diff --git a/src/core/cloudxr_tests/python/test_service.py b/tests/python/core/cloudxr/test_service.py similarity index 100% rename from src/core/cloudxr_tests/python/test_service.py rename to tests/python/core/cloudxr/test_service.py diff --git a/src/core/cloudxr_tests/python/test_service_cli.py b/tests/python/core/cloudxr/test_service_cli.py similarity index 100% rename from src/core/cloudxr_tests/python/test_service_cli.py rename to tests/python/core/cloudxr/test_service_cli.py diff --git a/src/core/cloudxr_tests/python/test_webclient.py b/tests/python/core/cloudxr/test_webclient.py similarity index 100% rename from src/core/cloudxr_tests/python/test_webclient.py rename to tests/python/core/cloudxr/test_webclient.py diff --git a/src/core/cloudxr_tests/python/test_wss_static_client.py b/tests/python/core/cloudxr/test_wss_static_client.py similarity index 100% rename from src/core/cloudxr_tests/python/test_wss_static_client.py rename to tests/python/core/cloudxr/test_wss_static_client.py diff --git a/src/core/retargeting_engine_tests/python/CMakeLists.txt b/tests/python/core/retargeting_engine/CMakeLists.txt similarity index 100% rename from src/core/retargeting_engine_tests/python/CMakeLists.txt rename to tests/python/core/retargeting_engine/CMakeLists.txt diff --git a/tests/python/core/retargeting_engine/__init__.py b/tests/python/core/retargeting_engine/__init__.py new file mode 100644 index 000000000..aebd94d02 --- /dev/null +++ b/tests/python/core/retargeting_engine/__init__.py @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Tests for retargeting_engine module.""" diff --git a/src/core/retargeting_engine_tests/python/conftest.py b/tests/python/core/retargeting_engine/conftest.py similarity index 88% rename from src/core/retargeting_engine_tests/python/conftest.py rename to tests/python/core/retargeting_engine/conftest.py index 304e69fac..ee844cc77 100644 --- a/src/core/retargeting_engine_tests/python/conftest.py +++ b/tests/python/core/retargeting_engine/conftest.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Pytest configuration and fixtures for isaacteleop.retargeting_engine tests.""" diff --git a/src/core/retargeting_engine_tests/python/pyproject.toml b/tests/python/core/retargeting_engine/pyproject.toml similarity index 100% rename from src/core/retargeting_engine_tests/python/pyproject.toml rename to tests/python/core/retargeting_engine/pyproject.toml diff --git a/src/core/retargeting_engine_tests/python/test_base_retargeter.py b/tests/python/core/retargeting_engine/test_base_retargeter.py similarity index 99% rename from src/core/retargeting_engine_tests/python/test_base_retargeter.py rename to tests/python/core/retargeting_engine/test_base_retargeter.py index 1788413f5..f1dc352d0 100644 --- a/src/core/retargeting_engine_tests/python/test_base_retargeter.py +++ b/tests/python/core/retargeting_engine/test_base_retargeter.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ diff --git a/src/core/retargeting_engine_tests/python/test_haptic_devices.py b/tests/python/core/retargeting_engine/test_haptic_devices.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_haptic_devices.py rename to tests/python/core/retargeting_engine/test_haptic_devices.py diff --git a/src/core/retargeting_engine_tests/python/test_haptic_sink.py b/tests/python/core/retargeting_engine/test_haptic_sink.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_haptic_sink.py rename to tests/python/core/retargeting_engine/test_haptic_sink.py diff --git a/src/core/retargeting_engine_tests/python/test_joint_state_retargeter.py b/tests/python/core/retargeting_engine/test_joint_state_retargeter.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_joint_state_retargeter.py rename to tests/python/core/retargeting_engine/test_joint_state_retargeter.py diff --git a/src/core/retargeting_engine_tests/python/test_joint_state_source.py b/tests/python/core/retargeting_engine/test_joint_state_source.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_joint_state_source.py rename to tests/python/core/retargeting_engine/test_joint_state_source.py diff --git a/src/core/retargeting_engine_tests/python/test_message_channel_nodes.py b/tests/python/core/retargeting_engine/test_message_channel_nodes.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_message_channel_nodes.py rename to tests/python/core/retargeting_engine/test_message_channel_nodes.py diff --git a/src/core/retargeting_engine_tests/python/test_ndarray_types.py b/tests/python/core/retargeting_engine/test_ndarray_types.py similarity index 98% rename from src/core/retargeting_engine_tests/python/test_ndarray_types.py rename to tests/python/core/retargeting_engine/test_ndarray_types.py index d683a4848..04c09b0fd 100644 --- a/src/core/retargeting_engine_tests/python/test_ndarray_types.py +++ b/tests/python/core/retargeting_engine/test_ndarray_types.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ diff --git a/src/core/retargeting_engine_tests/python/test_parameter_state.py b/tests/python/core/retargeting_engine/test_parameter_state.py similarity index 99% rename from src/core/retargeting_engine_tests/python/test_parameter_state.py rename to tests/python/core/retargeting_engine/test_parameter_state.py index 566c8d6da..d061ff1b6 100644 --- a/src/core/retargeting_engine_tests/python/test_parameter_state.py +++ b/tests/python/core/retargeting_engine/test_parameter_state.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Tests for ParameterState.""" diff --git a/src/core/retargeting_engine_tests/python/test_retargeter_composition.py b/tests/python/core/retargeting_engine/test_retargeter_composition.py similarity index 99% rename from src/core/retargeting_engine_tests/python/test_retargeter_composition.py rename to tests/python/core/retargeting_engine/test_retargeter_composition.py index 76512d59f..3fd635a74 100644 --- a/src/core/retargeting_engine_tests/python/test_retargeter_composition.py +++ b/tests/python/core/retargeting_engine/test_retargeter_composition.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ diff --git a/src/core/retargeting_engine_tests/python/test_retargeter_reset.py b/tests/python/core/retargeting_engine/test_retargeter_reset.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_retargeter_reset.py rename to tests/python/core/retargeting_engine/test_retargeter_reset.py diff --git a/src/core/retargeting_engine_tests/python/test_retargeter_timing.py b/tests/python/core/retargeting_engine/test_retargeter_timing.py similarity index 99% rename from src/core/retargeting_engine_tests/python/test_retargeter_timing.py rename to tests/python/core/retargeting_engine/test_retargeter_timing.py index 5ee9f875d..fb7dea74d 100644 --- a/src/core/retargeting_engine_tests/python/test_retargeter_timing.py +++ b/tests/python/core/retargeting_engine/test_retargeter_timing.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ diff --git a/src/core/retargeting_engine_tests/python/test_scalar_types.py b/tests/python/core/retargeting_engine/test_scalar_types.py similarity index 96% rename from src/core/retargeting_engine_tests/python/test_scalar_types.py rename to tests/python/core/retargeting_engine/test_scalar_types.py index 6a5b22429..80aac122e 100644 --- a/src/core/retargeting_engine_tests/python/test_scalar_types.py +++ b/tests/python/core/retargeting_engine/test_scalar_types.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ diff --git a/src/core/retargeting_engine_tests/python/test_se3_retargeter_pose_validity.py b/tests/python/core/retargeting_engine/test_se3_retargeter_pose_validity.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_se3_retargeter_pose_validity.py rename to tests/python/core/retargeting_engine/test_se3_retargeter_pose_validity.py diff --git a/src/core/retargeting_engine_tests/python/test_sharpa_hand_retargeter.py b/tests/python/core/retargeting_engine/test_sharpa_hand_retargeter.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_sharpa_hand_retargeter.py rename to tests/python/core/retargeting_engine/test_sharpa_hand_retargeter.py diff --git a/src/core/retargeting_engine_tests/python/test_so101_retargeters.py b/tests/python/core/retargeting_engine/test_so101_retargeters.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_so101_retargeters.py rename to tests/python/core/retargeting_engine/test_so101_retargeters.py diff --git a/src/core/retargeting_engine_tests/python/test_sources.py b/tests/python/core/retargeting_engine/test_sources.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_sources.py rename to tests/python/core/retargeting_engine/test_sources.py diff --git a/src/core/retargeting_engine_tests/python/test_tactile_retargeters.py b/tests/python/core/retargeting_engine/test_tactile_retargeters.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_tactile_retargeters.py rename to tests/python/core/retargeting_engine/test_tactile_retargeters.py diff --git a/src/core/retargeting_engine_tests/python/test_tensor.py b/tests/python/core/retargeting_engine/test_tensor.py similarity index 98% rename from src/core/retargeting_engine_tests/python/test_tensor.py rename to tests/python/core/retargeting_engine/test_tensor.py index ad100590b..8ec7044cd 100644 --- a/src/core/retargeting_engine_tests/python/test_tensor.py +++ b/tests/python/core/retargeting_engine/test_tensor.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ diff --git a/src/core/retargeting_engine_tests/python/test_tensor_group.py b/tests/python/core/retargeting_engine/test_tensor_group.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_tensor_group.py rename to tests/python/core/retargeting_engine/test_tensor_group.py diff --git a/src/core/retargeting_engine_tests/python/test_transform_numpy_versions.py b/tests/python/core/retargeting_engine/test_transform_numpy_versions.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_transform_numpy_versions.py rename to tests/python/core/retargeting_engine/test_transform_numpy_versions.py diff --git a/src/core/retargeting_engine_tests/python/test_transforms.py b/tests/python/core/retargeting_engine/test_transforms.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_transforms.py rename to tests/python/core/retargeting_engine/test_transforms.py diff --git a/src/core/retargeting_engine_tests/python/test_tunable_parameter.py b/tests/python/core/retargeting_engine/test_tunable_parameter.py similarity index 98% rename from src/core/retargeting_engine_tests/python/test_tunable_parameter.py rename to tests/python/core/retargeting_engine/test_tunable_parameter.py index b5997642d..1c00a6078 100644 --- a/src/core/retargeting_engine_tests/python/test_tunable_parameter.py +++ b/tests/python/core/retargeting_engine/test_tunable_parameter.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Tests for tunable parameter specifications (immutable specs, not values).""" diff --git a/src/core/retargeting_engine_tests/python/test_wuji_hand_retargeter.py b/tests/python/core/retargeting_engine/test_wuji_hand_retargeter.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_wuji_hand_retargeter.py rename to tests/python/core/retargeting_engine/test_wuji_hand_retargeter.py diff --git a/src/core/retargeting_engine_tests/python/test_wuji_mapping_tables.py b/tests/python/core/retargeting_engine/test_wuji_mapping_tables.py similarity index 100% rename from src/core/retargeting_engine_tests/python/test_wuji_mapping_tables.py rename to tests/python/core/retargeting_engine/test_wuji_mapping_tables.py diff --git a/src/core/retargeting_engine_tests/python/transform_numpy_version_smoke.py b/tests/python/core/retargeting_engine/transform_numpy_version_smoke.py similarity index 100% rename from src/core/retargeting_engine_tests/python/transform_numpy_version_smoke.py rename to tests/python/core/retargeting_engine/transform_numpy_version_smoke.py diff --git a/src/core/rig_tests/python/CMakeLists.txt b/tests/python/core/rig/CMakeLists.txt similarity index 100% rename from src/core/rig_tests/python/CMakeLists.txt rename to tests/python/core/rig/CMakeLists.txt diff --git a/src/core/rig_tests/python/conftest.py b/tests/python/core/rig/conftest.py similarity index 91% rename from src/core/rig_tests/python/conftest.py rename to tests/python/core/rig/conftest.py index 987c37ae6..6f02c2bae 100644 --- a/src/core/rig_tests/python/conftest.py +++ b/tests/python/core/rig/conftest.py @@ -20,7 +20,13 @@ import types from pathlib import Path -_RIG_PY = Path(__file__).resolve().parents[3] / "python" / "isaacteleop" / "rig" +_tests_python = Path(__file__).resolve().parents[2] +if str(_tests_python) not in sys.path: + sys.path.insert(0, str(_tests_python)) + +from repo_paths import repo_root # noqa: E402 + +_RIG_PY = repo_root() / "src" / "python" / "isaacteleop" / "rig" RIG_TEST_PKG = "rig_py_test_ns" diff --git a/src/core/rig_tests/python/pyproject.toml b/tests/python/core/rig/pyproject.toml similarity index 100% rename from src/core/rig_tests/python/pyproject.toml rename to tests/python/core/rig/pyproject.toml diff --git a/src/core/rig_tests/python/test_config.py b/tests/python/core/rig/test_config.py similarity index 100% rename from src/core/rig_tests/python/test_config.py rename to tests/python/core/rig/test_config.py diff --git a/src/core/rig_tests/python/test_launcher.py b/tests/python/core/rig/test_launcher.py similarity index 100% rename from src/core/rig_tests/python/test_launcher.py rename to tests/python/core/rig/test_launcher.py diff --git a/src/core/rig_tests/python/test_main.py b/tests/python/core/rig/test_main.py similarity index 100% rename from src/core/rig_tests/python/test_main.py rename to tests/python/core/rig/test_main.py diff --git a/src/core/schema_tests/python/CMakeLists.txt b/tests/python/core/schema/CMakeLists.txt similarity index 91% rename from src/core/schema_tests/python/CMakeLists.txt rename to tests/python/core/schema/CMakeLists.txt index 57e90a55c..67de567e3 100644 --- a/src/core/schema_tests/python/CMakeLists.txt +++ b/tests/python/core/schema/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ============================================================================== diff --git a/tests/python/core/schema/__init__.py b/tests/python/core/schema/__init__.py new file mode 100644 index 000000000..25e85b0de --- /dev/null +++ b/tests/python/core/schema/__init__.py @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Unit tests for isaacteleop.schema package.""" diff --git a/src/core/schema_tests/python/conftest.py b/tests/python/core/schema/conftest.py similarity index 92% rename from src/core/schema_tests/python/conftest.py rename to tests/python/core/schema/conftest.py index 0cc82cd6c..967fb57ab 100644 --- a/src/core/schema_tests/python/conftest.py +++ b/tests/python/core/schema/conftest.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Pytest configuration and fixtures for isaacteleop.schema tests.""" diff --git a/src/core/schema_tests/python/pyproject.toml b/tests/python/core/schema/pyproject.toml similarity index 100% rename from src/core/schema_tests/python/pyproject.toml rename to tests/python/core/schema/pyproject.toml diff --git a/src/core/schema_tests/python/test_camera.py b/tests/python/core/schema/test_camera.py similarity index 100% rename from src/core/schema_tests/python/test_camera.py rename to tests/python/core/schema/test_camera.py diff --git a/src/core/schema_tests/python/test_controller.py b/tests/python/core/schema/test_controller.py similarity index 100% rename from src/core/schema_tests/python/test_controller.py rename to tests/python/core/schema/test_controller.py diff --git a/src/core/schema_tests/python/test_full_body.py b/tests/python/core/schema/test_full_body.py similarity index 100% rename from src/core/schema_tests/python/test_full_body.py rename to tests/python/core/schema/test_full_body.py diff --git a/src/core/schema_tests/python/test_hand.py b/tests/python/core/schema/test_hand.py similarity index 100% rename from src/core/schema_tests/python/test_hand.py rename to tests/python/core/schema/test_hand.py diff --git a/src/core/schema_tests/python/test_head.py b/tests/python/core/schema/test_head.py similarity index 100% rename from src/core/schema_tests/python/test_head.py rename to tests/python/core/schema/test_head.py diff --git a/src/core/schema_tests/python/test_oglo_tactile.py b/tests/python/core/schema/test_oglo_tactile.py similarity index 100% rename from src/core/schema_tests/python/test_oglo_tactile.py rename to tests/python/core/schema/test_oglo_tactile.py diff --git a/src/core/schema_tests/python/test_pedals.py b/tests/python/core/schema/test_pedals.py similarity index 98% rename from src/core/schema_tests/python/test_pedals.py rename to tests/python/core/schema/test_pedals.py index ddcae524f..2d177e9dc 100644 --- a/src/core/schema_tests/python/test_pedals.py +++ b/tests/python/core/schema/test_pedals.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Unit tests for Generic3AxisPedalOutput type in isaacteleop.schema. diff --git a/src/core/schema_tests/python/test_pose.py b/tests/python/core/schema/test_pose.py similarity index 98% rename from src/core/schema_tests/python/test_pose.py rename to tests/python/core/schema/test_pose.py index 9dbee3a92..29e25a30a 100644 --- a/src/core/schema_tests/python/test_pose.py +++ b/tests/python/core/schema/test_pose.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Unit tests for Pose struct in isaacteleop.schema. diff --git a/src/core/schema_tests/python/test_se3_tracker.py b/tests/python/core/schema/test_se3_tracker.py similarity index 100% rename from src/core/schema_tests/python/test_se3_tracker.py rename to tests/python/core/schema/test_se3_tracker.py diff --git a/src/core/teleop_session_manager_tests/python/CMakeLists.txt b/tests/python/core/teleop_session_manager/CMakeLists.txt similarity index 92% rename from src/core/teleop_session_manager_tests/python/CMakeLists.txt rename to tests/python/core/teleop_session_manager/CMakeLists.txt index 3c698718b..3d38ae4db 100644 --- a/src/core/teleop_session_manager_tests/python/CMakeLists.txt +++ b/tests/python/core/teleop_session_manager/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ============================================================================== diff --git a/src/core/teleop_session_manager_tests/python/pyproject.toml b/tests/python/core/teleop_session_manager/pyproject.toml similarity index 100% rename from src/core/teleop_session_manager_tests/python/pyproject.toml rename to tests/python/core/teleop_session_manager/pyproject.toml diff --git a/src/core/teleop_session_manager_tests/python/test_external_oxr_handles.py b/tests/python/core/teleop_session_manager/test_external_oxr_handles.py similarity index 98% rename from src/core/teleop_session_manager_tests/python/test_external_oxr_handles.py rename to tests/python/core/teleop_session_manager/test_external_oxr_handles.py index 870aab375..817fa3faf 100644 --- a/src/core/teleop_session_manager_tests/python/test_external_oxr_handles.py +++ b/tests/python/core/teleop_session_manager/test_external_oxr_handles.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ diff --git a/src/core/teleop_session_manager_tests/python/test_pipeline_introspection.py b/tests/python/core/teleop_session_manager/test_pipeline_introspection.py similarity index 98% rename from src/core/teleop_session_manager_tests/python/test_pipeline_introspection.py rename to tests/python/core/teleop_session_manager/test_pipeline_introspection.py index edf28bcd9..c8b5849de 100644 --- a/src/core/teleop_session_manager_tests/python/test_pipeline_introspection.py +++ b/tests/python/core/teleop_session_manager/test_pipeline_introspection.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ diff --git a/src/core/teleop_session_manager_tests/python/test_session_reset.py b/tests/python/core/teleop_session_manager/test_session_reset.py similarity index 100% rename from src/core/teleop_session_manager_tests/python/test_session_reset.py rename to tests/python/core/teleop_session_manager/test_session_reset.py diff --git a/src/core/teleop_session_manager_tests/python/test_teleop_session.py b/tests/python/core/teleop_session_manager/test_teleop_session.py similarity index 100% rename from src/core/teleop_session_manager_tests/python/test_teleop_session.py rename to tests/python/core/teleop_session_manager/test_teleop_session.py diff --git a/src/viz/shaders_tests/CMakeLists.txt b/tests/python/examples/CMakeLists.txt similarity index 63% rename from src/viz/shaders_tests/CMakeLists.txt rename to tests/python/examples/CMakeLists.txt index a25478921..6253bddb6 100644 --- a/src/viz/shaders_tests/CMakeLists.txt +++ b/tests/python/examples/CMakeLists.txt @@ -1,7 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.20) - -# Build C++ tests -add_subdirectory(cpp) +add_subdirectory(mujoco_xr) +add_subdirectory(camera_viz) diff --git a/examples/camera_viz/tests/CMakeLists.txt b/tests/python/examples/camera_viz/CMakeLists.txt similarity index 100% rename from examples/camera_viz/tests/CMakeLists.txt rename to tests/python/examples/camera_viz/CMakeLists.txt diff --git a/examples/camera_viz/tests/conftest.py b/tests/python/examples/camera_viz/conftest.py similarity index 52% rename from examples/camera_viz/tests/conftest.py rename to tests/python/examples/camera_viz/conftest.py index 99876f339..2c1ec96f8 100644 --- a/examples/camera_viz/tests/conftest.py +++ b/tests/python/examples/camera_viz/conftest.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# Tests live in examples/camera_viz/tests/ but import from +# Tests live under tests/python/examples/camera_viz/ but import from # examples/camera_viz/ (the example's pipeline / sources modules). # Prepend the parent dir so those imports resolve against the in-tree # source rather than any installed copy. @@ -9,4 +9,10 @@ import sys from pathlib import Path -sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) +_tests_python = Path(__file__).resolve().parents[2] +if str(_tests_python) not in sys.path: + sys.path.insert(0, str(_tests_python)) + +from repo_paths import repo_root # noqa: E402 + +sys.path.insert(0, str(repo_root() / "examples" / "camera_viz")) diff --git a/examples/camera_viz/tests/pyproject.toml b/tests/python/examples/camera_viz/pyproject.toml similarity index 100% rename from examples/camera_viz/tests/pyproject.toml rename to tests/python/examples/camera_viz/pyproject.toml diff --git a/examples/camera_viz/tests/test_paired_frame_source_race.py b/tests/python/examples/camera_viz/test_paired_frame_source_race.py similarity index 100% rename from examples/camera_viz/tests/test_paired_frame_source_race.py rename to tests/python/examples/camera_viz/test_paired_frame_source_race.py diff --git a/examples/camera_viz/tests/test_runner_health.py b/tests/python/examples/camera_viz/test_runner_health.py similarity index 100% rename from examples/camera_viz/tests/test_runner_health.py rename to tests/python/examples/camera_viz/test_runner_health.py diff --git a/examples/camera_viz/tests/test_synthetic_offscreen.py b/tests/python/examples/camera_viz/test_synthetic_offscreen.py similarity index 98% rename from examples/camera_viz/tests/test_synthetic_offscreen.py rename to tests/python/examples/camera_viz/test_synthetic_offscreen.py index 76f3cb6a5..6339f9058 100644 --- a/examples/camera_viz/tests/test_synthetic_offscreen.py +++ b/tests/python/examples/camera_viz/test_synthetic_offscreen.py @@ -26,7 +26,7 @@ def _gpu_and_cupy_available() -> bool: except ImportError: return False # Cheap Vulkan + CUDA probe via VizSession construction; same shape - # as the existing src/viz/python_tests skipif. + # as the existing tests/python/viz skipif. cfg = viz.VizSessionConfig() cfg.mode = viz.DisplayMode.kOffscreen cfg.window_width = 64 diff --git a/examples/camera_viz/tests/test_video_file_source.py b/tests/python/examples/camera_viz/test_video_file_source.py similarity index 100% rename from examples/camera_viz/tests/test_video_file_source.py rename to tests/python/examples/camera_viz/test_video_file_source.py diff --git a/examples/mujoco_xr/tests/CMakeLists.txt b/tests/python/examples/mujoco_xr/CMakeLists.txt similarity index 93% rename from examples/mujoco_xr/tests/CMakeLists.txt rename to tests/python/examples/mujoco_xr/CMakeLists.txt index a14366f85..2eaa27e87 100644 --- a/examples/mujoco_xr/tests/CMakeLists.txt +++ b/tests/python/examples/mujoco_xr/CMakeLists.txt @@ -11,6 +11,11 @@ # second needs the same justification: what it covers is otherwise invisible # until someone is wearing a headset, and it needs no headset itself. +if(NOT TARGET mujoco_xr_py) + message(STATUS "mujoco_xr pytest skipped (mujoco_xr_py not built)") + return() +endif() + file(GLOB TEST_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/test_*.py" diff --git a/examples/mujoco_xr/tests/conftest.py b/tests/python/examples/mujoco_xr/conftest.py similarity index 70% rename from examples/mujoco_xr/tests/conftest.py rename to tests/python/examples/mujoco_xr/conftest.py index da957eec0..414668505 100644 --- a/examples/mujoco_xr/tests/conftest.py +++ b/tests/python/examples/mujoco_xr/conftest.py @@ -12,4 +12,10 @@ import sys from pathlib import Path -sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "python")) +_tests_python = Path(__file__).resolve().parents[2] +if str(_tests_python) not in sys.path: + sys.path.insert(0, str(_tests_python)) + +from repo_paths import repo_root # noqa: E402 + +sys.path.insert(0, str(repo_root() / "examples" / "mujoco_xr" / "python")) diff --git a/examples/mujoco_xr/tests/pyproject.toml b/tests/python/examples/mujoco_xr/pyproject.toml similarity index 100% rename from examples/mujoco_xr/tests/pyproject.toml rename to tests/python/examples/mujoco_xr/pyproject.toml diff --git a/examples/mujoco_xr/tests/test_app_helpers.py b/tests/python/examples/mujoco_xr/test_app_helpers.py similarity index 100% rename from examples/mujoco_xr/tests/test_app_helpers.py rename to tests/python/examples/mujoco_xr/test_app_helpers.py diff --git a/examples/mujoco_xr/tests/test_frames.py b/tests/python/examples/mujoco_xr/test_frames.py similarity index 100% rename from examples/mujoco_xr/tests/test_frames.py rename to tests/python/examples/mujoco_xr/test_frames.py diff --git a/examples/mujoco_xr/tests/test_ghost.py b/tests/python/examples/mujoco_xr/test_ghost.py similarity index 100% rename from examples/mujoco_xr/tests/test_ghost.py rename to tests/python/examples/mujoco_xr/test_ghost.py diff --git a/examples/mujoco_xr/tests/test_projection.py b/tests/python/examples/mujoco_xr/test_projection.py similarity index 100% rename from examples/mujoco_xr/tests/test_projection.py rename to tests/python/examples/mujoco_xr/test_projection.py diff --git a/examples/mujoco_xr/tests/test_readback.py b/tests/python/examples/mujoco_xr/test_readback.py similarity index 100% rename from examples/mujoco_xr/tests/test_readback.py rename to tests/python/examples/mujoco_xr/test_readback.py diff --git a/examples/teleop_ros2/python/tests/test_geometry.py b/tests/python/examples/teleop_ros2/test_geometry.py similarity index 100% rename from examples/teleop_ros2/python/tests/test_geometry.py rename to tests/python/examples/teleop_ros2/test_geometry.py diff --git a/examples/teleop_ros2/python/tests/test_messages.py b/tests/python/examples/teleop_ros2/test_messages.py similarity index 100% rename from examples/teleop_ros2/python/tests/test_messages.py rename to tests/python/examples/teleop_ros2/test_messages.py diff --git a/examples/teleop_ros2/python/tests/test_teleop_profiles.py b/tests/python/examples/teleop_ros2/test_teleop_profiles.py similarity index 100% rename from examples/teleop_ros2/python/tests/test_teleop_profiles.py rename to tests/python/examples/teleop_ros2/test_teleop_profiles.py diff --git a/tests/python/repo_paths.py b/tests/python/repo_paths.py new file mode 100644 index 000000000..f40530b20 --- /dev/null +++ b/tests/python/repo_paths.py @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Resolve paths from the IsaacTeleop repository root.""" + +from __future__ import annotations + +from pathlib import Path + + +def repo_root() -> Path: + """Return the repository root (directory containing VERSION and CMakeLists.txt).""" + for parent in Path(__file__).resolve().parents: + if (parent / "VERSION").is_file() and (parent / "CMakeLists.txt").is_file(): + return parent + msg = "Could not locate IsaacTeleop repository root" + raise RuntimeError(msg) diff --git a/src/viz/python_tests/CMakeLists.txt b/tests/python/viz/CMakeLists.txt similarity index 100% rename from src/viz/python_tests/CMakeLists.txt rename to tests/python/viz/CMakeLists.txt diff --git a/src/viz/python_tests/pyproject.toml b/tests/python/viz/pyproject.toml similarity index 100% rename from src/viz/python_tests/pyproject.toml rename to tests/python/viz/pyproject.toml diff --git a/src/viz/python_tests/test_array_interface.py b/tests/python/viz/test_array_interface.py similarity index 100% rename from src/viz/python_tests/test_array_interface.py rename to tests/python/viz/test_array_interface.py diff --git a/src/viz/python_tests/test_offscreen_session.py b/tests/python/viz/test_offscreen_session.py similarity index 100% rename from src/viz/python_tests/test_offscreen_session.py rename to tests/python/viz/test_offscreen_session.py diff --git a/src/viz/python_tests/test_projection_layer.py b/tests/python/viz/test_projection_layer.py similarity index 100% rename from src/viz/python_tests/test_projection_layer.py rename to tests/python/viz/test_projection_layer.py diff --git a/src/viz/python_tests/test_viz_import.py b/tests/python/viz/test_viz_import.py similarity index 100% rename from src/viz/python_tests/test_viz_import.py rename to tests/python/viz/test_viz_import.py