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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if options.platform == 'chromium': | 57 if options.platform == 'chromium': |
58 options.platform = None | 58 options.platform = None |
59 | 59 |
60 ports_to_lint = [host.port_factory.get(name) for name in host.port_facto
ry.all_port_names(options.platform)] | 60 ports_to_lint = [host.port_factory.get(name) for name in host.port_facto
ry.all_port_names(options.platform)] |
61 files_linted = set() | 61 files_linted = set() |
62 lint_failed = False | 62 lint_failed = False |
63 | 63 |
64 for port_to_lint in ports_to_lint: | 64 for port_to_lint in ports_to_lint: |
65 expectations_dict = port_to_lint.expectations_dict() | 65 expectations_dict = port_to_lint.expectations_dict() |
66 | 66 |
67 # FIXME: This won't work if multiple ports share a TestExpectations
file but support different modifiers in the file. | |
68 for expectations_file in expectations_dict.keys(): | 67 for expectations_file in expectations_dict.keys(): |
69 if expectations_file in files_linted: | 68 if expectations_file in files_linted: |
70 continue | 69 continue |
71 | 70 |
72 try: | 71 try: |
73 test_expectations.TestExpectations(port_to_lint, | 72 test_expectations.TestExpectations(port_to_lint, |
74 expectations_dict={expectations_file: expectations_dict[
expectations_file]}, | 73 expectations_dict={expectations_file: expectations_dict[
expectations_file]}, |
75 is_lint_mode=True) | 74 is_lint_mode=True) |
76 except test_expectations.ParseError as e: | 75 except test_expectations.ParseError as e: |
77 lint_failed = True | 76 lint_failed = True |
(...skipping 29 matching lines...) Expand all Loading... |
107 try: | 106 try: |
108 exit_status = lint(host, options, stderr) | 107 exit_status = lint(host, options, stderr) |
109 except KeyboardInterrupt: | 108 except KeyboardInterrupt: |
110 exit_status = INTERRUPTED_EXIT_STATUS | 109 exit_status = INTERRUPTED_EXIT_STATUS |
111 except Exception as e: | 110 except Exception as e: |
112 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) | 111 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) |
113 traceback.print_exc(file=stderr) | 112 traceback.print_exc(file=stderr) |
114 exit_status = EXCEPTIONAL_EXIT_STATUS | 113 exit_status = EXCEPTIONAL_EXIT_STATUS |
115 | 114 |
116 return exit_status | 115 return exit_status |
OLD | NEW |