| OLD | NEW |
| 1 #!/bin/env python | 1 #!/bin/env python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 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 # purify_analyze.py | 6 # purify_analyze.py |
| 7 | 7 |
| 8 ''' Given a Purify text file, parses messages, normalizes and uniques them. | 8 ''' Given a Purify text file, parses messages, normalizes and uniques them. |
| 9 If there's an existing baseline of this data, it can compare against that | 9 If there's an existing baseline of this data, it can compare against that |
| 10 baseline and return an error code if there are any new errors not in the | 10 baseline and return an error code if there are any new errors not in the |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 # information to report any message types that no longer happen at all. | 622 # information to report any message types that no longer happen at all. |
| 623 fixable = 0 | 623 fixable = 0 |
| 624 flakey = 0 | 624 flakey = 0 |
| 625 paths = [os.path.join(self._data_dir, x) | 625 paths = [os.path.join(self._data_dir, x) |
| 626 for x in os.listdir(self._data_dir)] | 626 for x in os.listdir(self._data_dir)] |
| 627 for path in paths: | 627 for path in paths: |
| 628 # We only care about this executable's files, and not its gtest filters. | 628 # We only care about this executable's files, and not its gtest filters. |
| 629 if (not os.path.basename(path).startswith(self._name) or | 629 if (not os.path.basename(path).startswith(self._name) or |
| 630 not path.endswith(".txt") or | 630 not path.endswith(".txt") or |
| 631 path.endswith("gtest.txt") or | 631 path.endswith("gtest.txt") or |
| 632 path.endswith("_ignore.txt") or |
| 632 not os.path.isfile(path)): | 633 not os.path.isfile(path)): |
| 633 continue | 634 continue |
| 634 msgs = self._MessageHashesFromFile(path) | 635 msgs = self._MessageHashesFromFile(path) |
| 635 if path.find("flakey") == -1: | 636 if path.find("flakey") == -1: |
| 636 fixable += len(msgs) | 637 fixable += len(msgs) |
| 637 else: | 638 else: |
| 638 flakey += len(msgs) | 639 flakey += len(msgs) |
| 639 | 640 |
| 640 logging.info("Fixable errors: %s" % fixable) | 641 logging.info("Fixable errors: %s" % fixable) |
| 641 logging.info("Flakey errors: %s" % flakey) | 642 logging.info("Flakey errors: %s" % flakey) |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 pa.PrintSummary(False) | 869 pa.PrintSummary(False) |
| 869 else: | 870 else: |
| 870 pa.PrintSummary(False) | 871 pa.PrintSummary(False) |
| 871 | 872 |
| 872 sys.exit(retcode) | 873 sys.exit(retcode) |
| 873 | 874 |
| 874 if __name__ == "__main__": | 875 if __name__ == "__main__": |
| 875 _main() | 876 _main() |
| 876 | 877 |
| 877 | 878 |
| OLD | NEW |