From 27e2c5ab78317fd79a50980b77fa93af42f2243d Mon Sep 17 00:00:00 2001 From: Ankit Meel Date: Fri, 29 Jan 2021 14:13:26 +0530 Subject: [PATCH] Tests, docs: Use sanitizer options from environment too. Don't overwrite environment variables that may contain options like suppression files, symboliser etc. It's similar to rBa181b156399a13fa429159112e30c8005d5e8a59 and rBA589d13408a60cbec34a8bc3cc798c586043743ae . For Blender Add-ons repo, see the equivalent in D9816. Reviewed By: Blendify Differential Revision: https://developer.blender.org/D9815 --- GNUmakefile | 2 +- build_files/cmake/Modules/GTestTesting.cmake | 4 +++- doc/manpage/blender.1.py | 5 +++-- doc/python_api/sphinx_doc_gen.sh | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 3b5b9d65521..532f9cb9bde 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -520,7 +520,7 @@ format: .FORCE # Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation. doc_py: .FORCE - ASAN_OPTIONS=halt_on_error=0 \ + ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \ $(BLENDER_BIN) --background -noaudio --factory-startup \ --python doc/python_api/sphinx_doc_gen.py sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake index 70f48fc33ea..0c78111eaaf 100644 --- a/build_files/cmake/Modules/GTestTesting.cmake +++ b/build_files/cmake/Modules/GTestTesting.cmake @@ -99,7 +99,9 @@ macro(BLENDER_SRC_GTEST_EX) # Don't fail tests on leaks since these often happen in external libraries # that we can't fix. - set_tests_properties(${TARGET_NAME} PROPERTIES ENVIRONMENT LSAN_OPTIONS=exitcode=0) + set_tests_properties(${TARGET_NAME} PROPERTIES + ENVIRONMENT LSAN_OPTIONS=exitcode=0:$ENV{LSAN_OPTIONS} + ) endif() if(WIN32) set_target_properties(${TARGET_NAME} PROPERTIES VS_GLOBAL_VcpkgEnabled "false") diff --git a/doc/manpage/blender.1.py b/doc/manpage/blender.1.py index da83abe8442..150548072d5 100755 --- a/doc/manpage/blender.1.py +++ b/doc/manpage/blender.1.py @@ -52,10 +52,11 @@ outfilename = sys.argv[2] cmd = [blender_bin, "--help"] print(" executing:", " ".join(cmd)) +ASAN_OPTIONS = "exitcode=0:" + os.environ.get("ASAN_OPTIONS", "") blender_help = subprocess.run( - cmd, env={"ASAN_OPTIONS": "exitcode=0"}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8") + cmd, env={"ASAN_OPTIONS": ASAN_OPTIONS}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8") blender_version = subprocess.run( - [blender_bin, "--version"], env={"ASAN_OPTIONS": "exitcode=0"}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8").strip() + [blender_bin, "--version"], env={"ASAN_OPTIONS": ASAN_OPTIONS}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8").strip() blender_version, blender_date = (blender_version.split("build") + [None, None])[0:2] blender_version = blender_version.rstrip().partition(" ")[2] # remove 'Blender' prefix. if blender_date is None: diff --git a/doc/python_api/sphinx_doc_gen.sh b/doc/python_api/sphinx_doc_gen.sh index 590de594875..26c3701f3e0 100755 --- a/doc/python_api/sphinx_doc_gen.sh +++ b/doc/python_api/sphinx_doc_gen.sh @@ -55,7 +55,7 @@ if $DO_EXE_BLENDER ; then # Don't delete existing docs, now partial updates are used for quick builds. # # Disable ASAN error halt since it results in nonzero exit code on any minor issue. - ASAN_OPTIONS=halt_on_error=0 \ + ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \ $BLENDER_BIN \ --background \ -noaudio \