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-06-20 13:36:03 +00:00
|
|
|
tests_cxx_wrappers
|
2022-07-20 14:39:29 +00:00
|
|
|
tests_deque
|
2022-06-20 13:36:03 +00:00
|
|
|
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_rational
|
2022-07-07 15:35:04 +00:00
|
|
|
tests_vector
|
2022-06-20 13:36:03 +00:00
|
|
|
tests_worker
|
|
|
|
tests_pose
|
2021-11-11 23:41:58 +00:00
|
|
|
)
|
2022-05-16 18:27:21 +00:00
|
|
|
if(XRT_HAVE_D3D11)
|
2022-05-16 19:16:24 +00:00
|
|
|
list(APPEND tests tests_aux_d3d tests_comp_client_d3d11)
|
|
|
|
endif()
|
|
|
|
if(XRT_HAVE_VULKAN)
|
|
|
|
list(APPEND tests tests_comp_client_vulkan)
|
2022-05-16 18:27:21 +00:00
|
|
|
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-06-13 19:56:19 +00:00
|
|
|
target_link_libraries(tests_pose PRIVATE aux_math)
|
2022-05-16 18:27:21 +00:00
|
|
|
|
2022-06-20 13:36:03 +00:00
|
|
|
if(XRT_BUILD_DRIVER_HANDTRACKING)
|
|
|
|
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)
|
|
|
|
endif()
|
|
|
|
|
2022-05-16 18:27:21 +00:00
|
|
|
if(XRT_HAVE_D3D11)
|
|
|
|
target_link_libraries(tests_aux_d3d PRIVATE aux_d3d)
|
2022-05-16 19:16:24 +00:00
|
|
|
target_link_libraries(tests_comp_client_d3d11 PRIVATE comp_client comp_mock)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(XRT_HAVE_VULKAN)
|
|
|
|
target_link_libraries(tests_comp_client_vulkan PRIVATE comp_client comp_mock comp_util aux_vk)
|
2022-05-16 18:27:21 +00:00
|
|
|
endif()
|