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

Side by Side Diff: tools/ipc_fuzzer/mutate/cf_package_builder.py

Issue 861113003: Fix issues with replay_process in ipc fuzzer. Make it compile on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Log to both stderr, file since stderr is hard to get on windows. Created 5 years, 11 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
« no previous file with comments | « build/all.gyp ('k') | tools/ipc_fuzzer/play_testcase.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Creates IPC fuzzer packages suitable for uploading to ClusterFuzz. Stores 6 """Creates IPC fuzzer packages suitable for uploading to ClusterFuzz. Stores
7 the packages into chrome build directory. See fuzzer_list below for the list of 7 the packages into chrome build directory. See fuzzer_list below for the list of
8 fuzzers. 8 fuzzers.
9 """ 9 """
10 10
11 import argparse 11 import argparse
12 import distutils.archive_util 12 import distutils.archive_util
13 import os 13 import os
14 import shutil 14 import shutil
15 import sys 15 import sys
16 import tempfile 16 import tempfile
17 17
18 FUZZER_LIST = [
19 'ipc_fuzzer_mut',
20 'ipc_fuzzer_gen',
21 ]
22
23 def GetPlatform():
24 platform = None
25 if sys.platform.startswith('win'):
26 platform = 'WINDOWS'
27 elif sys.platform.startswith('linux'):
28 platform = 'LINUX'
29 elif sys.platform == 'darwin':
30 platform = 'MAC'
31
32 assert platform is not None
33 return platform
34
18 class CFPackageBuilder: 35 class CFPackageBuilder:
19 def __init__(self): 36 def __init__(self):
20 self.fuzzer_list = [ 37 self.platform = GetPlatform()
21 'ipc_fuzzer_mut', 38 if self.platform == 'WINDOWS':
22 'ipc_fuzzer_gen', 39 self.fuzzer_list = [i + '.exe' for i in FUZZER_LIST]
23 ] 40 else:
41 self.fuzzer_list = FUZZER_LIST
24 42
25 def parse_args(self): 43 def parse_args(self):
26 desc = 'Builder of IPC fuzzer packages for ClusterFuzz' 44 desc = 'Builder of IPC fuzzer packages for ClusterFuzz'
27 parser = argparse.ArgumentParser(description=desc) 45 parser = argparse.ArgumentParser(description=desc)
28 parser.add_argument('--out-dir', dest='out_dir', default='out', 46 parser.add_argument('--out-dir', dest='out_dir', default='out',
29 help='output directory under src/ directory') 47 help='output directory under src/ directory')
30 parser.add_argument('--build-type', dest='build_type', default='Release', 48 parser.add_argument('--build-type', dest='build_type', default='Release',
31 help='Debug vs. Release build') 49 help='Debug vs. Release build')
32 self.args = parser.parse_args() 50 self.args = parser.parse_args()
33 51
(...skipping 30 matching lines...) Expand all
64 self.get_paths() 82 self.get_paths()
65 self.enter_tmp_workdir() 83 self.enter_tmp_workdir()
66 for fuzzer in self.fuzzer_list: 84 for fuzzer in self.fuzzer_list:
67 self.build_package(fuzzer) 85 self.build_package(fuzzer)
68 self.rm_tmp_workdir() 86 self.rm_tmp_workdir()
69 return 0 87 return 0
70 88
71 if __name__ == "__main__": 89 if __name__ == "__main__":
72 builder = CFPackageBuilder() 90 builder = CFPackageBuilder()
73 sys.exit(builder.main()) 91 sys.exit(builder.main())
OLDNEW
« no previous file with comments | « build/all.gyp ('k') | tools/ipc_fuzzer/play_testcase.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698