Build: make running executables as part of build/tests work with shared libs
Ensure the environment is set up for blender_test, idiff and oslc so that they can find the required shared libraries. Also deduplicate add_bundled_libraries() between Linux and macOS. Includes contributions by Ray Molenkamp and Brecht Van Lommel. Ref T99618
This commit is contained in:
@@ -31,6 +31,9 @@ function(add_blender_test testname)
|
||||
set_tests_properties(${testname} PROPERTIES ENVIRONMENT
|
||||
LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS}
|
||||
)
|
||||
if(PLATFORM_ENV_INSTALL)
|
||||
set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${PLATFORM_ENV_INSTALL}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Run Python script outside Blender.
|
||||
@@ -42,10 +45,14 @@ function(add_python_test testname testscript)
|
||||
add_test(
|
||||
NAME ${testname}
|
||||
COMMAND ${TEST_PYTHON_EXE} ${TEST_PYTHON_EXE_EXTRA_ARGS} ${testscript} ${ARGN}
|
||||
WORKING_DIRECTORY $<TARGET_FILE_DIR:blender>
|
||||
)
|
||||
set_tests_properties(${testname} PROPERTIES ENVIRONMENT
|
||||
LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS}
|
||||
)
|
||||
if(PLATFORM_ENV_INSTALL)
|
||||
set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${PLATFORM_ENV_INSTALL}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user