OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """A manual version of trace_inputs.py that is specialized in tracing each | 6 """A manual version of trace_inputs.py that is specialized in tracing each |
7 google-test test case individually. | 7 google-test test case individually. |
8 | 8 |
9 This is mainly written to work around bugs in strace w.r.t. browser_tests. | 9 This is mainly written to work around bugs in strace w.r.t. browser_tests. |
10 """ | 10 """ |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 start = time.time() | 50 start = time.time() |
51 returncode, output = trace_inputs.trace( | 51 returncode, output = trace_inputs.trace( |
52 logname, cmd, os.path.join(root_dir, cwd_dir), api, True) | 52 logname, cmd, os.path.join(root_dir, cwd_dir), api, True) |
53 if returncode and i < 5: | 53 if returncode and i < 5: |
54 print '\nFailed while running: %s' % ' '.join(cmd) | 54 print '\nFailed while running: %s' % ' '.join(cmd) |
55 continue | 55 continue |
56 duration = time.time() - start | 56 duration = time.time() - start |
57 try: | 57 try: |
58 results, simplified = trace_inputs.load_trace(logname, root_dir, api) | 58 results, simplified = trace_inputs.load_trace(logname, root_dir, api) |
59 break | 59 break |
60 except Exception: | 60 except trace_inputs.TracingFailure, e: |
61 print '\nFailed loading the trace for: %s' % ' '.join(cmd) | 61 print >> sys.stderr, '\nTracing failed for: %s' % ' '.join(cmd) |
| 62 print >> sys.stderr, str(e) |
62 if simplified: | 63 if simplified: |
63 variables = trace_inputs.generate_dict(simplified, cwd_dir, product_dir) | 64 variables = trace_inputs.generate_dict(simplified, cwd_dir, product_dir) |
64 else: | 65 else: |
65 variables = {} | 66 variables = {} |
66 return { | 67 return { |
67 'case': test_case, | 68 'case': test_case, |
68 'duration': duration, | 69 'duration': duration, |
69 'output': output, | 70 'output': output, |
70 'processes': processes, | 71 'processes': processes, |
71 'result': returncode, | 72 'result': returncode, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 options.cwd, | 210 options.cwd, |
210 options.product_dir, | 211 options.product_dir, |
211 options.leak, | 212 options.leak, |
212 options.skip, | 213 options.skip, |
213 options.jobs, | 214 options.jobs, |
214 options.timeout) | 215 options.timeout) |
215 | 216 |
216 | 217 |
217 if __name__ == '__main__': | 218 if __name__ == '__main__': |
218 sys.exit(main()) | 219 sys.exit(main()) |
OLD | NEW |