Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: testing/libfuzzer/gen_fuzzer_runner.py

Issue 1703523002: [libfuzzer] support of custom libfuzzer options via .options file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace .sh-wrapper script with .options config file. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/python
2 #
3 # Copyright (c) 2015 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """Generate .sh runner for libfuzzer test.
8
9 Invoked by GN from fuzzer_test.gni.
10 """
11
12 import argparse
13 import os
14 import sys
15
16
17 parser = argparse.ArgumentParser(description="Generate fuzzer launcher.")
18 parser.add_argument('--fuzzer', required=True)
19 parser.add_argument('--launcher', required=True)
20 parser.add_argument('--dict', required=True)
21 args = parser.parse_args()
22
23 out = open(args.launcher, 'w')
24 out.write("""#!/bin/bash
25 set -ue
26 DIR=$(dirname $0)
27 $DIR/%(fuzzer)s -dict=$DIR/%(dict)s $*
28 """ % { "fuzzer": args.fuzzer, "dict": args.dict })
29 out.close()
30
31 os.chmod(args.launcher, os.stat(args.launcher).st_mode | 0o111) # chmod a+x
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698