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

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: 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_FOR_PLATFORM_DICT = {
Tom Sepez 2015/01/22 00:13:05 We should probably just have code to add a ".exe"
19 'LINUX': ['ipc_fuzzer_mut', 'ipc_fuzzer_gen'],
20 'MAC': ['ipc_fuzzer_mut', 'ipc_fuzzer_gen'],
21 'WINDOWS': ['ipc_fuzzer_mut.exe', 'ipc_fuzzer_gen.exe'],
22 }
23
24 def GetPlatform():
25 if sys.platform.startswith('win'):
26 return 'WINDOWS'
27 elif sys.platform.startswith('linux'):
Tom Sepez 2015/01/22 00:13:05 nit: elif after return
28 return 'LINUX'
29 elif sys.platform == 'darwin':
30 return 'MAC'
31
18 class CFPackageBuilder: 32 class CFPackageBuilder:
19 def __init__(self): 33 def __init__(self):
20 self.fuzzer_list = [ 34 self.platform = GetPlatform()
21 'ipc_fuzzer_mut', 35 self.fuzzer_list = FUZZER_LIST_FOR_PLATFORM_DICT[self.platform]
22 'ipc_fuzzer_gen',
23 ]
24 36
25 def parse_args(self): 37 def parse_args(self):
26 desc = 'Builder of IPC fuzzer packages for ClusterFuzz' 38 desc = 'Builder of IPC fuzzer packages for ClusterFuzz'
27 parser = argparse.ArgumentParser(description=desc) 39 parser = argparse.ArgumentParser(description=desc)
28 parser.add_argument('--out-dir', dest='out_dir', default='out', 40 parser.add_argument('--out-dir', dest='out_dir', default='out',
29 help='output directory under src/ directory') 41 help='output directory under src/ directory')
30 parser.add_argument('--build-type', dest='build_type', default='Release', 42 parser.add_argument('--build-type', dest='build_type', default='Release',
31 help='Debug vs. Release build') 43 help='Debug vs. Release build')
32 self.args = parser.parse_args() 44 self.args = parser.parse_args()
33 45
(...skipping 30 matching lines...) Expand all
64 self.get_paths() 76 self.get_paths()
65 self.enter_tmp_workdir() 77 self.enter_tmp_workdir()
66 for fuzzer in self.fuzzer_list: 78 for fuzzer in self.fuzzer_list:
67 self.build_package(fuzzer) 79 self.build_package(fuzzer)
68 self.rm_tmp_workdir() 80 self.rm_tmp_workdir()
69 return 0 81 return 0
70 82
71 if __name__ == "__main__": 83 if __name__ == "__main__":
72 builder = CFPackageBuilder() 84 builder = CFPackageBuilder()
73 sys.exit(builder.main()) 85 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