@@ -545,8 +545,8 @@ def main():
545
545
help = 'Generate coverage reports for each unit test framework run.' )
546
546
parser .add_argument ('--engine-capture-core-dump' , dest = 'engine_capture_core_dump' , action = 'store_true' ,
547
547
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. ' )
550
550
551
551
args = parser .parse_args ()
552
552
@@ -559,8 +559,17 @@ def main():
559
559
if args .type != 'java' :
560
560
assert os .path .exists (build_dir ), 'Build variant directory %s does not exist!' % build_dir
561
561
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.
564
573
565
574
engine_filter = args .engine_filter .split (',' ) if args .engine_filter else None
566
575
if 'engine' in types :
0 commit comments