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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 PROGRESS_INDICATORS = ['verbose', 'dots', 'color', 'mono'] | 43 PROGRESS_INDICATORS = ['verbose', 'dots', 'color', 'mono'] |
44 | 44 |
45 | 45 |
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", |
| 54 help='Base output directory', |
| 55 default='out') |
53 | 56 |
54 # Flags this wrapper script handles itself: | 57 # Flags this wrapper script handles itself: |
55 result.add_option("-m", "--mode", | 58 result.add_option("-m", "--mode", |
56 help="The test modes in which to run (comma-separated)", | 59 help="The test modes in which to run (comma-separated)", |
57 default='release,debug') | 60 default='release,debug') |
58 result.add_option("--arch", | 61 result.add_option("--arch", |
59 help='The architectures to run tests for (comma-separated)', | 62 help='The architectures to run tests for (comma-separated)', |
60 default='ia32,x64,arm') | 63 default='ia32,x64,arm') |
61 | 64 |
62 # Flags that are passed on to the wrapped test.py script: | 65 # Flags that are passed on to the wrapped test.py script: |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 workspace = abspath(join(dirname(sys.argv[0]), '..')) | 204 workspace = abspath(join(dirname(sys.argv[0]), '..')) |
202 args_for_children = [workspace + '/tools/test.py'] + PassOnOptions(options) | 205 args_for_children = [workspace + '/tools/test.py'] + PassOnOptions(options) |
203 args_for_children += ['--no-build', '--build-system=gyp'] | 206 args_for_children += ['--no-build', '--build-system=gyp'] |
204 for arg in args: | 207 for arg in args: |
205 args_for_children += [arg] | 208 args_for_children += [arg] |
206 returncodes = 0 | 209 returncodes = 0 |
207 | 210 |
208 for mode in options.mode: | 211 for mode in options.mode: |
209 for arch in options.arch: | 212 for arch in options.arch: |
210 print ">>> running tests for %s.%s" % (arch, mode) | 213 print ">>> running tests for %s.%s" % (arch, mode) |
211 shell = workspace + '/out/' + arch + '.' + mode + "/shell" | 214 shell = workspace + '/' + options.outdir + '/' + arch + '.' + mode + "/d8" |
212 child = subprocess.Popen(' '.join(args_for_children + | 215 child = subprocess.Popen(' '.join(args_for_children + |
213 ['--mode=' + mode] + | 216 ['--mode=' + mode] + |
214 ['--shell=' + shell]), | 217 ['--shell=' + shell]), |
215 shell=True, | 218 shell=True, |
216 cwd=workspace) | 219 cwd=workspace) |
217 returncodes += child.wait() | 220 returncodes += child.wait() |
218 | 221 |
219 return returncodes | 222 return returncodes |
220 | 223 |
221 | 224 |
222 if __name__ == '__main__': | 225 if __name__ == '__main__': |
223 sys.exit(Main()) | 226 sys.exit(Main()) |
OLD | NEW |