Index: tools/run-tests.py |
diff --git a/tools/run-tests.py b/tools/run-tests.py |
index c94457fe6d296479393ea99044536d2bfe002a55..55c1eb9a465f5bf930db1c387745321bd418ed13 100755 |
--- a/tools/run-tests.py |
+++ b/tools/run-tests.py |
@@ -208,6 +208,8 @@ def BuildOptions(): |
result.add_option("--asan", |
help="Regard test expectations for ASAN", |
default=False, action="store_true") |
+ result.add_option("--sancov-dir", |
+ help="Directory where to collect coverage data") |
result.add_option("--cfi-vptr", |
help="Run tests with UBSAN cfi_vptr option.", |
default=False, action="store_true") |
@@ -385,6 +387,14 @@ def SetupEnvironment(options): |
if options.asan: |
os.environ['ASAN_OPTIONS'] = symbolizer |
+ if options.sancov_dir: |
+ assert os.path.exists(options.sancov_dir) |
+ os.environ['ASAN_OPTIONS'] = ":".join([ |
+ 'coverage=1', |
+ 'coverage_dir=%s' % options.sancov_dir, |
+ symbolizer, |
+ ]) |
+ |
if options.cfi_vptr: |
os.environ['UBSAN_OPTIONS'] = ":".join([ |
'print_stacktrace=1', |
@@ -688,7 +698,8 @@ def Execute(arch, mode, args, options, suites): |
options.rerun_failures_max, |
options.predictable, |
options.no_harness, |
- use_perf_data=not options.swarming) |
+ use_perf_data=not options.swarming, |
+ sancov_dir=options.sancov_dir) |
# TODO(all): Combine "simulator" and "simulator_run". |
simulator_run = not options.dont_skip_simulator_slow_tests and \ |