OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS 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 | 6 |
7 """Parses and displays the contents of one or more autoserv result directories. | 7 """Parses and displays the contents of one or more autoserv result directories. |
8 | 8 |
9 This script parses the contents of one or more autoserv results folders and | 9 This script parses the contents of one or more autoserv results folders and |
10 generates test reports. | 10 generates test reports. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 Args: | 91 Args: |
92 testdir: The autoserv test result directory. | 92 testdir: The autoserv test result directory. |
93 """ | 93 """ |
94 | 94 |
95 status_file = os.path.join(testdir, 'status.log') | 95 status_file = os.path.join(testdir, 'status.log') |
96 if not os.path.isfile(status_file): | 96 if not os.path.isfile(status_file): |
97 status_file = os.path.join(testdir, 'status') | 97 status_file = os.path.join(testdir, 'status') |
98 if not os.path.isfile(status_file): | 98 if not os.path.isfile(status_file): |
99 return | 99 return |
100 | 100 |
| 101 # Remove false positives that are missing a debug dir. |
| 102 if not os.path.exists(os.path.join(testdir, 'debug')): |
| 103 return |
| 104 |
101 status_raw = open(status_file, 'r').read() | 105 status_raw = open(status_file, 'r').read() |
102 status = 'FAIL' | 106 status = 'FAIL' |
103 if (re.search(r'GOOD.+completed successfully', status_raw) and | 107 if (re.search(r'GOOD.+completed successfully', status_raw) and |
104 not re.search(r'ABORT|ERROR|FAIL|TEST_NA', status_raw)): | 108 not re.search(r'ABORT|ERROR|FAIL|TEST_NA', status_raw)): |
105 status = 'PASS' | 109 status = 'PASS' |
106 | 110 |
107 perf = self._CollectPerf(testdir) | 111 perf = self._CollectPerf(testdir) |
108 | 112 |
109 if testdir.startswith(self._options.strip): | 113 if testdir.startswith(self._options.strip): |
110 testdir = testdir.replace(self._options.strip, '', 1) | 114 testdir = testdir.replace(self._options.strip, '', 1) |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 if not args: | 270 if not args: |
267 parser.print_help() | 271 parser.print_help() |
268 Die('no result directories provided') | 272 Die('no result directories provided') |
269 | 273 |
270 generator = ReportGenerator(options, args) | 274 generator = ReportGenerator(options, args) |
271 generator.Run() | 275 generator.Run() |
272 | 276 |
273 | 277 |
274 if __name__ == '__main__': | 278 if __name__ == '__main__': |
275 main() | 279 main() |
OLD | NEW |