| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 """Runner for Mojo application benchmarks.""" | 6 """Runner for Mojo application benchmarks.""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import logging | 9 import logging |
| 10 import sys | 10 import sys |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 print 'timed out' if did_time_out else 'failed' | 82 print 'timed out' if did_time_out else 'failed' |
| 83 if return_code: | 83 if return_code: |
| 84 print 'Return code: ' + str(return_code) | 84 print 'Return code: ' + str(return_code) |
| 85 print 'Output: ' | 85 print 'Output: ' |
| 86 print output | 86 print output |
| 87 print '-' * 72 | 87 print '-' * 72 |
| 88 return False | 88 return False |
| 89 | 89 |
| 90 # Echo measurement results. | 90 # Echo measurement results. |
| 91 for line in output_lines: | 91 for line in output_lines: |
| 92 if line.strip().startswith('measurement:'): | 92 if line.strip().startswith('measurement:') or 'WARNING' in line: |
| 93 print line | 93 print line |
| 94 return True | 94 return True |
| 95 | 95 |
| 96 | 96 |
| 97 def main(): | 97 def main(): |
| 98 parser = argparse.ArgumentParser( | 98 parser = argparse.ArgumentParser( |
| 99 formatter_class=argparse.RawDescriptionHelpFormatter, | 99 formatter_class=argparse.RawDescriptionHelpFormatter, |
| 100 description=_DESCRIPTION) | 100 description=_DESCRIPTION) |
| 101 parser.add_argument('benchmark_list_file', type=file, | 101 parser.add_argument('benchmark_list_file', type=file, |
| 102 help='a file listing benchmarks to run') | 102 help='a file listing benchmarks to run') |
| (...skipping 23 matching lines...) Expand all Loading... |
| 126 measurements = benchmark_spec['measurements'] | 126 measurements = benchmark_spec['measurements'] |
| 127 _run_benchmark(shell, shell_args, name, app, duration, measurements, | 127 _run_benchmark(shell, shell_args, name, app, duration, measurements, |
| 128 cold_start=True, verbose=script_args.verbose) | 128 cold_start=True, verbose=script_args.verbose) |
| 129 _run_benchmark(shell, shell_args, name, app, duration, measurements, | 129 _run_benchmark(shell, shell_args, name, app, duration, measurements, |
| 130 cold_start=False, verbose=script_args.verbose) | 130 cold_start=False, verbose=script_args.verbose) |
| 131 | 131 |
| 132 return 0 if succeeded else 1 | 132 return 0 if succeeded else 1 |
| 133 | 133 |
| 134 if __name__ == '__main__': | 134 if __name__ == '__main__': |
| 135 sys.exit(main()) | 135 sys.exit(main()) |
| OLD | NEW |