test: make ASAN/UBSAN_OPTIONS overridable from the outside
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 8 Jul 2019 11:47:46 +0000 (13:47 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 Jul 2019 17:00:14 +0000 (02:00 +0900)
This should allow us to tweak the ASAN_OPTIONS and UBSAN_OPTIONS env
variables for integration tests as well

test/test-functions

index 4a76dd7..8db4060 100644 (file)
@@ -395,8 +395,8 @@ create_asan_wrapper() {
 
 set -x
 
-DEFAULT_ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
-DEFAULT_UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1
+DEFAULT_ASAN_OPTIONS=${ASAN_OPTIONS:-strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1}
+DEFAULT_UBSAN_OPTIONS=${UBSAN_OPTIONS:-print_stacktrace=1:print_summary=1:halt_on_error=1}
 DEFAULT_ENVIRONMENT="ASAN_OPTIONS=\$DEFAULT_ASAN_OPTIONS UBSAN_OPTIONS=\$DEFAULT_UBSAN_OPTIONS"
 
 # As right now bash is the PID 1, we can't expect PATH to have a sane value.