Tests: use environment variable for leak sanitizer

Don't override other `LSAN_OPTIONS` like suppression file set in
the environment variable.

Old code added in {rB38ff5064b33ccb8} and {rB5f4e99b7a2b8376}

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9207
This commit is contained in:
Ankit Meel 2020-10-14 12:32:35 +05:30
parent 5edba9b42f
commit a181b15639
Notes: blender-bot 2023-02-14 08:06:35 +01:00
Referenced by commit 27e2c5ab78, Tests, docs: Use sanitizer options from environment too.
1 changed files with 6 additions and 2 deletions

View File

@ -43,7 +43,9 @@ function(add_blender_test testname)
# Don't fail tests on leaks since these often happen in external libraries
# that we can't fix.
set_tests_properties(${testname} PROPERTIES ENVIRONMENT LSAN_OPTIONS=exitcode=0)
set_tests_properties(${testname} PROPERTIES ENVIRONMENT
LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS}
)
endfunction()
# Run Python script outside Blender.
@ -56,7 +58,9 @@ function(add_python_test testname testscript)
NAME ${testname}
COMMAND ${TEST_PYTHON_EXE} ${testscript} ${ARGN}
)
set_tests_properties(${testname} PROPERTIES ENVIRONMENT LSAN_OPTIONS=exitcode=0)
set_tests_properties(${testname} PROPERTIES ENVIRONMENT
LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS}
)
endfunction()
# ------------------------------------------------------------------------------