[infra] Make coverage run with dict and options.

This commit is contained in:
Oliver Chang 2017-05-31 12:44:25 -07:00
parent af86b0cbdb
commit c093b7101d
1 changed files with 7 additions and 2 deletions

View File

@ -354,16 +354,21 @@ def coverage(args):
temp_dir = tempfile.mkdtemp() temp_dir = tempfile.mkdtemp()
run_args = [ run_args = [
'-e', 'FUZZING_ENGINE=libfuzzer',
'-e', 'ASAN_OPTIONS=coverage_dir=/cov',
'-e', 'MSAN_OPTIONS=coverage_dir=/cov',
'-e', 'UBSAN_OPTIONS=coverage_dir=/cov',
'-v', '%s:/out' % os.path.join(BUILD_DIR, 'out', args.project_name), '-v', '%s:/out' % os.path.join(BUILD_DIR, 'out', args.project_name),
'-v', '%s:/cov' % temp_dir, '-v', '%s:/cov' % temp_dir,
'-w', '/cov', '-w', '/cov',
'-t', 'gcr.io/oss-fuzz-base/base-runner', '-t', 'gcr.io/oss-fuzz-base/base-runner',
'/out/%s' % args.fuzzer_name, 'run_fuzzer',
args.fuzzer_name,
'-dump_coverage=1', '-dump_coverage=1',
'-max_total_time=%s' % args.run_time '-max_total_time=%s' % args.run_time
] + args.fuzzer_args ] + args.fuzzer_args
print('This may take a while (running your fuzzer for %d seconds)...' % print('This may take a while (running your fuzzer for %s seconds)...' %
args.run_time) args.run_time)
docker_run(run_args, print_output=False) docker_run(run_args, print_output=False)