@@ -545,8 +545,8 @@ def main():
545545 help = 'Generate coverage reports for each unit test framework run.' )
546546 parser .add_argument ('--engine-capture-core-dump' , dest = 'engine_capture_core_dump' , action = 'store_true' ,
547547 default = False , help = 'Capture core dumps from crashes of engine tests.' )
548- parser .add_argument ('--asan-options ' , dest = 'asan_options ' , action = 'store' , type = str , default = ' ' ,
549- help = 'Runtime AddressSanitizer flags to use if built wth asan (example: "verbosity=1:detect_leaks=0 ' )
548+ parser .add_argument ('--use-sanitizer-suppressions ' , dest = 'sanitizer_suppressions ' , action = 'store_true ' ,
549+ default = False , help = 'Provide the sanitizer suppressions lists to the via environment to the tests. ' )
550550
551551 args = parser .parse_args ()
552552
@@ -559,8 +559,17 @@ def main():
559559 if args .type != 'java' :
560560 assert os .path .exists (build_dir ), 'Build variant directory %s does not exist!' % build_dir
561561
562- if args .asan_options :
563- os .environ ['ASAN_OPTIONS' ] = args .asan_options
562+ if args .sanitizer_suppressions :
563+ file_dir = os .path .dirname (os .path .abspath (__file__ ))
564+ command = [
565+ "env" , "-i" , "bash" ,
566+ "-c" , "source {}/sanitizer_suppressions.sh >/dev/null && env" .format (file_dir )
567+ ]
568+ process = subprocess .Popen (command , stdout = subprocess .PIPE )
569+ for line in process .stdout :
570+ key , _ , value = str (line ).partition ("=" )
571+ os .environ [key ] = value
572+ process .communicate () # Avoid pipe deadlock while waiting for termination.
564573
565574 engine_filter = args .engine_filter .split (',' ) if args .engine_filter else None
566575 if 'engine' in types :
0 commit comments