ctest: fix tests when compiling with sanitizers

When compiling with sanitizers that require LD_LIBRARY_PATH (see
documentation), ctest could not drive tests as the executables did not
find shared objects. Fix the directory to the current build directory to
enable running with sanitizers.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
This commit is contained in:
Robert Schmidt
2026-04-23 13:56:13 +02:00
parent 38dc378224
commit d4f039a326

View File

@@ -39,7 +39,7 @@ function(add_physim_test test_name test_description test_exec)
# pass test description also through environment variable: for cmake < 3.30, # pass test description also through environment variable: for cmake < 3.30,
# in JSON export, we cannot recover the description otherwise # in JSON export, we cannot recover the description otherwise
# see also https://gitlab.kitware.com/cmake/cmake/-/issues/21490 # see also https://gitlab.kitware.com/cmake/cmake/-/issues/21490
ENVIRONMENT "LD_LIBRARY_PATH=.;TEST_DESCRIPTION=${test_description}" ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR};TEST_DESCRIPTION=${test_description}"
) )
set_tests_properties(${test_name} PROPERTIES CHECK_COUNT 0) set_tests_properties(${test_name} PROPERTIES CHECK_COUNT 0)
add_dependencies(tests ${test_exec}) add_dependencies(tests ${test_exec})