| 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 self._SaveGroupSummary(current_list) | 853 self._SaveGroupSummary(current_list) |
| 854 | 854 |
| 855 if errors: | 855 if errors: |
| 856 logging.error("%d total new errors found" % errors) | 856 logging.error("%d total new errors found" % errors) |
| 857 return -1 | 857 return -1 |
| 858 else: | 858 else: |
| 859 logging.info("no new errors found - yay!") | 859 logging.info("no new errors found - yay!") |
| 860 if fixes: | 860 if fixes: |
| 861 logging.warning("%d total errors unexpectedly fixed" % fixes) | 861 logging.warning("%d total errors unexpectedly fixed" % fixes) |
| 862 # magic return code to turn the builder orange (via ReturnCodeCommand) | 862 # magic return code to turn the builder orange (via ReturnCodeCommand) |
| 863 return -88 | 863 return 88 |
| 864 return 0 | 864 return 0 |
| 865 | 865 |
| 866 | 866 |
| 867 # The following code is here for testing and development purposes. | 867 # The following code is here for testing and development purposes. |
| 868 | 868 |
| 869 def _main(): | 869 def _main(): |
| 870 retcode = 0 | 870 retcode = 0 |
| 871 | 871 |
| 872 parser = optparse.OptionParser("usage: %prog [options] <files to analyze>") | 872 parser = optparse.OptionParser("usage: %prog [options] <files to analyze>") |
| 873 parser.add_option("-b", "--baseline", action="store_true", default=False, | 873 parser.add_option("-b", "--baseline", action="store_true", default=False, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 pa.Summary(False) | 930 pa.Summary(False) |
| 931 else: | 931 else: |
| 932 pa.Summary(False) | 932 pa.Summary(False) |
| 933 | 933 |
| 934 sys.exit(retcode) | 934 sys.exit(retcode) |
| 935 | 935 |
| 936 if __name__ == "__main__": | 936 if __name__ == "__main__": |
| 937 _main() | 937 _main() |
| 938 | 938 |
| 939 | 939 |
| OLD | NEW |