| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """Run Performance Test Bisect Tool | 6 """Run Performance Test Bisect Tool |
| 7 | 7 |
| 8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py | 8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py |
| 9 script with the parameters specified in run-bisect-perf-regression.cfg. It will | 9 script with the parameters specified in run-bisect-perf-regression.cfg. It will |
| 10 check out a copy of the depot in a subdirectory 'bisect' of the working | 10 check out a copy of the depot in a subdirectory 'bisect' of the working |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 if config['repeat_count']: | 75 if config['repeat_count']: |
| 76 cmd.extend(['-r', config['repeat_count']]) | 76 cmd.extend(['-r', config['repeat_count']]) |
| 77 | 77 |
| 78 if config['truncate_percent']: | 78 if config['truncate_percent']: |
| 79 cmd.extend(['-t', config['truncate_percent']]) | 79 cmd.extend(['-t', config['truncate_percent']]) |
| 80 | 80 |
| 81 if config['max_time_minutes']: | 81 if config['max_time_minutes']: |
| 82 cmd.extend(['--repeat_test_max_time', config['max_time_minutes']]) | 82 cmd.extend(['--repeat_test_max_time', config['max_time_minutes']]) |
| 83 | 83 |
| 84 if os.name == 'nt': | 84 cmd.extend(['--build_preference', 'ninja']) |
| 85 cmd.extend(['--build_preference', 'ninja']) | |
| 86 else: | |
| 87 cmd.extend(['--build_preference', 'make']) | |
| 88 | 85 |
| 89 if '--browser=cros' in config['command']: | 86 if '--browser=cros' in config['command']: |
| 90 cmd.extend(['--target_platform', 'cros']) | 87 cmd.extend(['--target_platform', 'cros']) |
| 91 | 88 |
| 92 if os.environ[CROS_BOARD_ENV] and os.environ[CROS_IP_ENV]: | 89 if os.environ[CROS_BOARD_ENV] and os.environ[CROS_IP_ENV]: |
| 93 cmd.extend(['--cros_board', os.environ[CROS_BOARD_ENV]]) | 90 cmd.extend(['--cros_board', os.environ[CROS_BOARD_ENV]]) |
| 94 cmd.extend(['--cros_remote_ip', os.environ[CROS_IP_ENV]]) | 91 cmd.extend(['--cros_remote_ip', os.environ[CROS_IP_ENV]]) |
| 95 else: | 92 else: |
| 96 print 'Error: Cros build selected, but BISECT_CROS_IP or'\ | 93 print 'Error: Cros build selected, but BISECT_CROS_IP or'\ |
| 97 'BISECT_CROS_BOARD undefined.' | 94 'BISECT_CROS_BOARD undefined.' |
| 98 print | 95 print |
| 99 return 1 | 96 return 1 |
| 100 | 97 |
| 98 if '--browser=android' in config['command']: |
| 99 cmd.extend(['--target_platform', 'android']) |
| 100 |
| 101 goma_file = '' | 101 goma_file = '' |
| 102 if path_to_goma: | 102 if path_to_goma: |
| 103 path_to_goma = os.path.abspath(path_to_goma) | 103 path_to_goma = os.path.abspath(path_to_goma) |
| 104 | 104 |
| 105 if os.name == 'nt': | 105 if os.name == 'nt': |
| 106 os.environ['CC'] = os.path.join(path_to_goma, 'gomacc.exe') + ' cl.exe' | 106 os.environ['CC'] = os.path.join(path_to_goma, 'gomacc.exe') + ' cl.exe' |
| 107 os.environ['CXX'] = os.path.join(path_to_goma, 'gomacc.exe') + ' cl.exe' | 107 os.environ['CXX'] = os.path.join(path_to_goma, 'gomacc.exe') + ' cl.exe' |
| 108 goma_file = os.path.join(path_to_goma, 'goma_ctl.bat') | 108 goma_file = os.path.join(path_to_goma, 'goma_ctl.bat') |
| 109 else: | 109 else: |
| 110 os.environ['PATH'] = os.pathsep.join([path_to_goma, os.environ['PATH']]) | 110 os.environ['PATH'] = os.pathsep.join([path_to_goma, os.environ['PATH']]) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 'run-bisect-perf-regression.cfg for syntax errors.' | 170 'run-bisect-perf-regression.cfg for syntax errors.' |
| 171 print | 171 print |
| 172 return 1 | 172 return 1 |
| 173 | 173 |
| 174 return RunBisectionScript(config, opts.working_directory, path_to_file, | 174 return RunBisectionScript(config, opts.working_directory, path_to_file, |
| 175 opts.path_to_goma) | 175 opts.path_to_goma) |
| 176 | 176 |
| 177 | 177 |
| 178 if __name__ == '__main__': | 178 if __name__ == '__main__': |
| 179 sys.exit(main()) | 179 sys.exit(main()) |
| OLD | NEW |