OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project 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 import argparse | 6 import argparse |
7 import os | 7 import os |
8 import subprocess | 8 import subprocess |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 'sunspider', | 46 'sunspider', |
47 ] | 47 ] |
48 | 48 |
49 V8_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) | 49 V8_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) |
50 | 50 |
51 def main(): | 51 def main(): |
52 parser = argparse.ArgumentParser(description='') | 52 parser = argparse.ArgumentParser(description='') |
53 parser.add_argument('benchmarks', nargs='+', help='The benchmarks to run.') | 53 parser.add_argument('benchmarks', nargs='+', help='The benchmarks to run.') |
54 parser.add_argument('--extra-flags', default='', | 54 parser.add_argument('--extra-flags', default='', |
55 help='Extra flags to be passed to the executable.') | 55 help='Extra flags to be passed to the executable.') |
| 56 parser.add_argument('-r', '--revision', type=str, default=None, |
| 57 help='Revision (use full hash!) to use for the try job; ' |
| 58 'default: the revision will be determined by the ' |
| 59 'try server; see its waterfall for more info') |
56 for option in sorted(BOTS): | 60 for option in sorted(BOTS): |
57 parser.add_argument( | 61 parser.add_argument( |
58 option, dest='bots', action='append_const', const=BOTS[option], | 62 option, dest='bots', action='append_const', const=BOTS[option], |
59 help='Add %s trybot.' % BOTS[option]) | 63 help='Add %s trybot.' % BOTS[option]) |
60 options = parser.parse_args() | 64 options = parser.parse_args() |
61 if not options.bots: | 65 if not options.bots: |
62 print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS) | 66 print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS) |
63 options.bots = DEFAULT_BOTS | 67 options.bots = DEFAULT_BOTS |
64 | 68 |
65 if not options.benchmarks: | 69 if not options.benchmarks: |
(...skipping 12 matching lines...) Expand all Loading... |
78 | 82 |
79 assert '"' not in options.extra_flags and '\'' not in options.extra_flags, ( | 83 assert '"' not in options.extra_flags and '\'' not in options.extra_flags, ( |
80 'Invalid flag specification.') | 84 'Invalid flag specification.') |
81 | 85 |
82 # Ensure depot_tools are updated. | 86 # Ensure depot_tools are updated. |
83 subprocess.check_output( | 87 subprocess.check_output( |
84 'gclient', shell=True, stderr=subprocess.STDOUT, cwd=V8_BASE) | 88 'gclient', shell=True, stderr=subprocess.STDOUT, cwd=V8_BASE) |
85 | 89 |
86 cmd = ['git cl try -m internal.client.v8'] | 90 cmd = ['git cl try -m internal.client.v8'] |
87 cmd += ['-b %s' % bot for bot in options.bots] | 91 cmd += ['-b %s' % bot for bot in options.bots] |
| 92 if options.revision: cmd += ['-r %s' % options.revision] |
88 benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks] | 93 benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks] |
89 cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)] | 94 cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)] |
90 if options.extra_flags: | 95 if options.extra_flags: |
91 cmd += ['-p \'extra_flags="%s"\'' % options.extra_flags] | 96 cmd += ['-p \'extra_flags="%s"\'' % options.extra_flags] |
92 subprocess.check_call(' '.join(cmd), shell=True, cwd=V8_BASE) | 97 subprocess.check_call(' '.join(cmd), shell=True, cwd=V8_BASE) |
93 | 98 |
94 | 99 |
95 if __name__ == '__main__': # pragma: no cover | 100 if __name__ == '__main__': # pragma: no cover |
96 sys.exit(main()) | 101 sys.exit(main()) |
OLD | NEW |