| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 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 """Traces each test cases of a google-test executable individually. | 6 """Traces each test cases of a google-test executable individually. |
| 7 | 7 |
| 8 Gives detailed information about each test case. The logs can be read afterward | 8 Gives detailed information about each test case. The logs can be read afterward |
| 9 with ./trace_inputs.py read -l /path/to/executable.logs | 9 with ./trace_inputs.py read -l /path/to/executable.logs |
| 10 """ | 10 """ |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 'tracename': tracename, | 60 'tracename': tracename, |
| 61 'returncode': returncode, | 61 'returncode': returncode, |
| 62 'duration': duration, | 62 'duration': duration, |
| 63 'valid': valid, | 63 'valid': valid, |
| 64 'output': output, | 64 'output': output, |
| 65 }) | 65 }) |
| 66 logging.debug( | 66 logging.debug( |
| 67 'Tracing %s done: %d, %.1fs' % (test_case, returncode, duration)) | 67 'Tracing %s done: %d, %.1fs' % (test_case, returncode, duration)) |
| 68 if retry: | 68 if retry: |
| 69 self.progress.update_item( | 69 self.progress.update_item( |
| 70 '%s - %d' % (test_case, retry), index=True, size=not valid) | 70 '%s - %d' % (test_case, retry), index=1, size=int(not valid)) |
| 71 else: | 71 else: |
| 72 self.progress.update_item(test_case, index=True, size=not valid) | 72 self.progress.update_item(test_case, index=1, size=int(not valid)) |
| 73 if valid: | 73 if valid: |
| 74 break | 74 break |
| 75 return out | 75 return out |
| 76 | 76 |
| 77 | 77 |
| 78 def trace_test_cases(cmd, cwd_dir, test_cases, jobs, logname): | 78 def trace_test_cases(cmd, cwd_dir, test_cases, jobs, logname): |
| 79 """Traces each test cases individually but all in parallel.""" | 79 """Traces each test cases individually but all in parallel.""" |
| 80 assert os.path.isabs(cwd_dir) and os.path.isdir(cwd_dir), cwd_dir | 80 assert os.path.isabs(cwd_dir) and os.path.isdir(cwd_dir), cwd_dir |
| 81 | 81 |
| 82 if not test_cases: | 82 if not test_cases: |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 options.jobs, | 197 options.jobs, |
| 198 logname) | 198 logname) |
| 199 print('Reading trace logs...') | 199 print('Reading trace logs...') |
| 200 blacklist = trace_inputs.gen_blacklist(options.trace_blacklist) | 200 blacklist = trace_inputs.gen_blacklist(options.trace_blacklist) |
| 201 write_details(logname, options.out, options.root_dir, blacklist, results) | 201 write_details(logname, options.out, options.root_dir, blacklist, results) |
| 202 return 0 | 202 return 0 |
| 203 | 203 |
| 204 | 204 |
| 205 if __name__ == '__main__': | 205 if __name__ == '__main__': |
| 206 sys.exit(main()) | 206 sys.exit(main()) |
| OLD | NEW |