2022-01-18 20:18:49 +00:00
|
|
|
# Copyright 2018-2022, Collabora, Ltd.
|
2021-11-03 19:22:13 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
2020-06-15 15:58:48 +00:00
|
|
|
|
|
|
|
# Catch2 main test driver
|
|
|
|
add_library(tests_main STATIC tests_main.cpp)
|
|
|
|
target_link_libraries(tests_main PUBLIC xrt-external-catch2)
|
|
|
|
if(ANDROID)
|
|
|
|
target_link_libraries(tests_main PUBLIC log)
|
|
|
|
endif()
|
|
|
|
|
2022-05-16 18:27:21 +00:00
|
|
|
set(tests
|
2022-09-19 18:50:32 +00:00
|
|
|
tests_cxx_wrappers
|
|
|
|
tests_deque
|
|
|
|
tests_generic_callbacks
|
|
|
|
tests_history_buf
|
|
|
|
tests_id_ringbuffer
|
|
|
|
tests_input_transform
|
|
|
|
tests_json
|
|
|
|
tests_lowpass_float
|
|
|
|
tests_lowpass_integer
|
|
|
|
tests_pacing
|
|
|
|
tests_quatexpmap
|
|
|
|
tests_quat_change_of_basis
|
2022-11-23 19:02:24 +00:00
|
|
|
tests_quat_swing_twist
|
2022-09-19 18:50:32 +00:00
|
|
|
tests_rational
|
2022-12-23 23:05:44 +00:00
|
|
|
tests_relation_chain
|
2022-09-19 18:50:32 +00:00
|
|
|
tests_vector
|
|
|
|
tests_worker
|
|
|
|
tests_pose
|
2022-11-29 09:11:05 +00:00
|
|
|
tests_vec3_angle
|
2021-11-11 23:41:58 +00:00
|
|
|
)
|
2022-05-16 18:27:21 +00:00
|
|
|
if(XRT_HAVE_D3D11)
|
2022-05-24 23:02:31 +00:00
|
|
|
list(APPEND tests tests_aux_d3d_d3d11 tests_comp_client_d3d11)
|
2022-05-16 19:16:24 +00:00
|
|
|
endif()
|
2022-07-18 17:25:30 +00:00
|
|
|
if(XRT_HAVE_D3D12)
|
|
|
|
list(APPEND tests tests_comp_client_d3d12)
|
|
|
|
endif()
|
2022-05-16 19:16:24 +00:00
|
|
|
if(XRT_HAVE_VULKAN)
|
2023-10-03 23:39:21 +00:00
|
|
|
list(APPEND tests tests_comp_client_vulkan tests_uv_to_tangent)
|
2022-05-16 18:27:21 +00:00
|
|
|
endif()
|
2022-08-22 18:36:56 +00:00
|
|
|
if(XRT_HAVE_OPENGL
|
2022-08-23 09:41:30 +00:00
|
|
|
AND XRT_HAVE_OPENGL_GLX
|
2022-08-22 18:36:56 +00:00
|
|
|
AND XRT_HAVE_SDL2
|
|
|
|
AND (WIN32 OR VK_USE_PLATFORM_XLIB_XRANDR_EXT)
|
|
|
|
)
|
|
|
|
set(_have_opengl_test ON)
|
|
|
|
list(APPEND tests tests_comp_client_opengl)
|
|
|
|
endif()
|
2022-06-20 13:36:03 +00:00
|
|
|
if(XRT_BUILD_DRIVER_HANDTRACKING)
|
|
|
|
list(APPEND tests tests_levenbergmarquardt)
|
|
|
|
endif()
|
2021-03-26 19:49:54 +00:00
|
|
|
|
2022-06-20 13:36:03 +00:00
|
|
|
foreach(testname ${tests})
|
2022-02-18 21:38:00 +00:00
|
|
|
add_executable(${testname} ${testname}.cpp)
|
|
|
|
target_link_libraries(${testname} PRIVATE tests_main)
|
|
|
|
target_link_libraries(${testname} PRIVATE aux_util)
|
|
|
|
add_test(NAME ${testname} COMMAND ${testname} --success)
|
|
|
|
endforeach()
|
2021-10-31 03:18:12 +00:00
|
|
|
|
2022-02-18 21:38:00 +00:00
|
|
|
# For tests that require more than just aux_util, link those other libs down here.
|
2021-12-02 21:43:25 +00:00
|
|
|
|
2022-02-18 21:38:00 +00:00
|
|
|
target_link_libraries(tests_cxx_wrappers PRIVATE xrt-interfaces)
|
|
|
|
target_link_libraries(tests_history_buf PRIVATE aux_math)
|
|
|
|
target_link_libraries(tests_input_transform PRIVATE st_oxr xrt-interfaces xrt-external-openxr)
|
2022-02-22 20:37:15 +00:00
|
|
|
target_link_libraries(tests_lowpass_float PRIVATE aux_math)
|
|
|
|
target_link_libraries(tests_lowpass_integer PRIVATE aux_math)
|
2021-12-22 15:16:27 +00:00
|
|
|
target_link_libraries(tests_quatexpmap PRIVATE aux_math)
|
2022-01-28 23:49:38 +00:00
|
|
|
target_link_libraries(tests_rational PRIVATE aux_math)
|
2022-12-23 23:05:44 +00:00
|
|
|
target_link_libraries(tests_relation_chain PRIVATE aux_math)
|
2022-06-13 19:56:19 +00:00
|
|
|
target_link_libraries(tests_pose PRIVATE aux_math)
|
2022-09-18 13:04:34 +00:00
|
|
|
target_link_libraries(tests_quat_change_of_basis PRIVATE aux_math)
|
2022-11-23 19:02:24 +00:00
|
|
|
target_link_libraries(tests_quat_swing_twist PRIVATE aux_math)
|
2022-11-29 09:11:05 +00:00
|
|
|
target_link_libraries(tests_vec3_angle PRIVATE aux_math)
|
2022-09-18 13:04:34 +00:00
|
|
|
|
|
|
|
target_include_directories(tests_quat_change_of_basis SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
|
2022-11-23 19:02:24 +00:00
|
|
|
target_include_directories(tests_quat_swing_twist SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
|
2022-09-18 13:04:34 +00:00
|
|
|
|
2022-06-20 13:36:03 +00:00
|
|
|
if(XRT_BUILD_DRIVER_HANDTRACKING)
|
2022-08-22 18:36:56 +00:00
|
|
|
target_link_libraries(
|
|
|
|
tests_levenbergmarquardt
|
|
|
|
PRIVATE
|
|
|
|
aux_math
|
|
|
|
t_ht_mercury_includes
|
|
|
|
t_ht_mercury_kine_lm_includes
|
|
|
|
t_ht_mercury
|
|
|
|
t_ht_mercury_kine_lm
|
|
|
|
)
|
2022-06-20 13:36:03 +00:00
|
|
|
endif()
|
|
|
|
|
2022-05-16 18:27:21 +00:00
|
|
|
if(XRT_HAVE_D3D11)
|
2022-05-24 23:02:31 +00:00
|
|
|
target_link_libraries(tests_aux_d3d_d3d11 PRIVATE aux_d3d)
|
2022-05-16 19:16:24 +00:00
|
|
|
target_link_libraries(tests_comp_client_d3d11 PRIVATE comp_client comp_mock)
|
|
|
|
endif()
|
|
|
|
|
2022-05-24 23:02:31 +00:00
|
|
|
if(XRT_HAVE_D3D12)
|
2022-07-18 17:25:30 +00:00
|
|
|
target_link_libraries(tests_comp_client_d3d12 PRIVATE comp_client comp_mock)
|
2022-05-24 23:02:31 +00:00
|
|
|
endif()
|
|
|
|
|
2022-05-16 19:16:24 +00:00
|
|
|
if(XRT_HAVE_VULKAN)
|
2022-08-22 18:36:56 +00:00
|
|
|
target_link_libraries(
|
|
|
|
tests_comp_client_vulkan PRIVATE comp_client comp_mock comp_util aux_vk
|
|
|
|
)
|
2023-10-03 23:39:21 +00:00
|
|
|
target_link_libraries(tests_uv_to_tangent PRIVATE comp_render)
|
2022-08-22 18:36:56 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(_have_opengl_test)
|
|
|
|
target_link_libraries(
|
2023-05-15 16:41:34 +00:00
|
|
|
tests_comp_client_opengl PRIVATE comp_client comp_mock aux_ogl SDL2::SDL2
|
2022-08-22 18:36:56 +00:00
|
|
|
)
|
2023-05-15 16:41:34 +00:00
|
|
|
target_include_directories(tests_comp_client_opengl PRIVATE SDL2::SDL2)
|
2022-05-16 18:27:21 +00:00
|
|
|
endif()
|
2022-07-20 19:16:21 +00:00
|
|
|
|
|
|
|
if(XRT_HAVE_VULKAN AND XRT_HAVE_D3D11)
|
|
|
|
target_link_libraries(tests_aux_d3d_d3d11 PRIVATE comp_util aux_vk)
|
|
|
|
endif()
|