| OLD | NEW |
| 1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 _log = logging.getLogger(__name__) | 47 _log = logging.getLogger(__name__) |
| 48 | 48 |
| 49 | 49 |
| 50 def lint(host, options): | 50 def lint(host, options): |
| 51 ports_to_lint = [host.port_factory.get(name) for name in host.port_factory.a
ll_port_names(options.platform)] | 51 ports_to_lint = [host.port_factory.get(name) for name in host.port_factory.a
ll_port_names(options.platform)] |
| 52 files_linted = set() | 52 files_linted = set() |
| 53 | 53 |
| 54 failures = [] | 54 failures = [] |
| 55 for port_to_lint in ports_to_lint: | 55 for port_to_lint in ports_to_lint: |
| 56 expectations_dict = port_to_lint.expectations_dict() | 56 expectations_dict = port_to_lint.all_expectations_dict() |
| 57 | 57 |
| 58 for expectations_file in expectations_dict.keys(): | 58 for expectations_file in expectations_dict.keys(): |
| 59 if expectations_file in files_linted: | 59 if expectations_file in files_linted: |
| 60 continue | 60 continue |
| 61 | 61 |
| 62 try: | 62 try: |
| 63 test_expectations.TestExpectations(port_to_lint, | 63 test_expectations.TestExpectations(port_to_lint, |
| 64 expectations_dict={expectatio
ns_file: expectations_dict[expectations_file]}, | 64 expectations_dict={expectatio
ns_file: expectations_dict[expectations_file]}, |
| 65 is_lint_mode=True) | 65 is_lint_mode=True) |
| 66 except test_expectations.ParseError as e: | 66 except test_expectations.ParseError as e: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 try: | 142 try: |
| 143 exit_status = run_checks(host, options, stderr) | 143 exit_status = run_checks(host, options, stderr) |
| 144 except KeyboardInterrupt: | 144 except KeyboardInterrupt: |
| 145 exit_status = INTERRUPTED_EXIT_STATUS | 145 exit_status = INTERRUPTED_EXIT_STATUS |
| 146 except Exception as e: | 146 except Exception as e: |
| 147 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) | 147 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) |
| 148 traceback.print_exc(file=stderr) | 148 traceback.print_exc(file=stderr) |
| 149 exit_status = EXCEPTIONAL_EXIT_STATUS | 149 exit_status = EXCEPTIONAL_EXIT_STATUS |
| 150 | 150 |
| 151 return exit_status | 151 return exit_status |
| OLD | NEW |