OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2011 the V8 project authors. All rights reserved. | 3 # Copyright 2011 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 def BuildOptions(): | 46 def BuildOptions(): |
47 result = optparse.OptionParser() | 47 result = optparse.OptionParser() |
48 | 48 |
49 # Flags specific to this wrapper script: | 49 # Flags specific to this wrapper script: |
50 result.add_option("--arch-and-mode", | 50 result.add_option("--arch-and-mode", |
51 help='Architecture and mode in the format "arch.mode"', | 51 help='Architecture and mode in the format "arch.mode"', |
52 default=None) | 52 default=None) |
53 result.add_option("--outdir", | 53 result.add_option("--outdir", |
54 help='Base output directory', | 54 help='Base output directory', |
55 default='out') | 55 default='out') |
| 56 result.add_option("--no-presubmit", |
| 57 help='Skip presubmit checks', |
| 58 default=False, action="store_true") |
56 | 59 |
57 # Flags this wrapper script handles itself: | 60 # Flags this wrapper script handles itself: |
58 result.add_option("-m", "--mode", | 61 result.add_option("-m", "--mode", |
59 help="The test modes in which to run (comma-separated)", | 62 help="The test modes in which to run (comma-separated)", |
60 default='release,debug') | 63 default='release,debug') |
61 result.add_option("--arch", | 64 result.add_option("--arch", |
62 help='The architectures to run tests for (comma-separated)', | 65 help='The architectures to run tests for (comma-separated)', |
63 default='ia32,x64,arm') | 66 default='ia32,x64,arm') |
64 | 67 |
65 # Flags that are passed on to the wrapped test.py script: | 68 # Flags that are passed on to the wrapped test.py script: |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 198 |
196 | 199 |
197 def Main(): | 200 def Main(): |
198 parser = BuildOptions() | 201 parser = BuildOptions() |
199 (options, args) = parser.parse_args() | 202 (options, args) = parser.parse_args() |
200 if not ProcessOptions(options): | 203 if not ProcessOptions(options): |
201 parser.print_help() | 204 parser.print_help() |
202 return 1 | 205 return 1 |
203 | 206 |
204 workspace = abspath(join(dirname(sys.argv[0]), '..')) | 207 workspace = abspath(join(dirname(sys.argv[0]), '..')) |
| 208 |
| 209 if not options.no_presubmit: |
| 210 print ">>> running presubmit tests" |
| 211 subprocess.call([workspace + '/tools/presubmit.py']) |
| 212 |
205 args_for_children = [workspace + '/tools/test.py'] + PassOnOptions(options) | 213 args_for_children = [workspace + '/tools/test.py'] + PassOnOptions(options) |
206 args_for_children += ['--no-build', '--build-system=gyp'] | 214 args_for_children += ['--no-build', '--build-system=gyp'] |
207 for arg in args: | 215 for arg in args: |
208 args_for_children += [arg] | 216 args_for_children += [arg] |
209 returncodes = 0 | 217 returncodes = 0 |
210 | 218 |
211 for mode in options.mode: | 219 for mode in options.mode: |
212 for arch in options.arch: | 220 for arch in options.arch: |
213 print ">>> running tests for %s.%s" % (arch, mode) | 221 print ">>> running tests for %s.%s" % (arch, mode) |
214 shell = workspace + '/' + options.outdir + '/' + arch + '.' + mode + "/d8" | 222 shell = workspace + '/' + options.outdir + '/' + arch + '.' + mode + "/d8" |
215 child = subprocess.Popen(' '.join(args_for_children + | 223 child = subprocess.Popen(' '.join(args_for_children + |
216 ['--arch=' + arch] + | 224 ['--arch=' + arch] + |
217 ['--mode=' + mode] + | 225 ['--mode=' + mode] + |
218 ['--shell=' + shell]), | 226 ['--shell=' + shell]), |
219 shell=True, | 227 shell=True, |
220 cwd=workspace) | 228 cwd=workspace) |
221 returncodes += child.wait() | 229 returncodes += child.wait() |
222 | 230 |
223 return returncodes | 231 return returncodes |
224 | 232 |
225 | 233 |
226 if __name__ == '__main__': | 234 if __name__ == '__main__': |
227 sys.exit(Main()) | 235 sys.exit(Main()) |
OLD | NEW |