| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 ''' | 3 ''' |
| 4 Copyright 2012 Google Inc. | 4 Copyright 2012 Google Inc. |
| 5 | 5 |
| 6 Use of this source code is governed by a BSD-style license that can be | 6 Use of this source code is governed by a BSD-style license that can be |
| 7 found in the LICENSE file. | 7 found in the LICENSE file. |
| 8 ''' | 8 ''' |
| 9 | 9 |
| 10 ''' | 10 ''' |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 going, or exit the program right away.""" | 114 going, or exit the program right away.""" |
| 115 # Get traceback information about the most recently raised exception. | 115 # Get traceback information about the most recently raised exception. |
| 116 exc_info = sys.exc_info() | 116 exc_info = sys.exc_info() |
| 117 | 117 |
| 118 if self._keep_going_on_failure: | 118 if self._keep_going_on_failure: |
| 119 print >> sys.stderr, ('WARNING: swallowing exception %s' % | 119 print >> sys.stderr, ('WARNING: swallowing exception %s' % |
| 120 repr(exc_info[1])) | 120 repr(exc_info[1])) |
| 121 self._failures_encountered.append(exc_info) | 121 self._failures_encountered.append(exc_info) |
| 122 else: | 122 else: |
| 123 print >> sys.stderr, ( | 123 print >> sys.stderr, ( |
| 124 'Halting at first exception; to keep going, re-run ' + | 124 '\nHalting at first exception.\n' + |
| 125 'with the --keep-going-on-failure option set.') | 125 'Please file a bug to epoger@google.com at ' + |
| 126 'https://code.google.com/p/skia/issues/entry, containing the ' + |
| 127 'command you ran and the following stack trace.\n\n' + |
| 128 'Afterwards, you can re-run with the --keep-going-on-failure ' + |
| 129 'option set.\n') |
| 126 raise exc_info[1], None, exc_info[2] | 130 raise exc_info[1], None, exc_info[2] |
| 127 | 131 |
| 128 def ReportAllFailures(self): | 132 def ReportAllFailures(self): |
| 129 if self._failures_encountered: | 133 if self._failures_encountered: |
| 130 print >> sys.stderr, ('Encountered %d failures (see above).' % | 134 print >> sys.stderr, ('Encountered %d failures (see above).' % |
| 131 len(self._failures_encountered)) | 135 len(self._failures_encountered)) |
| 132 sys.exit(1) | 136 sys.exit(1) |
| 133 | 137 |
| 134 | 138 |
| 135 # Object that rebaselines a JSON expectations file (not individual image files). | 139 # Object that rebaselines a JSON expectations file (not individual image files). |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 except: | 421 except: |
| 418 exception_handler.RaiseExceptionOrContinue() | 422 exception_handler.RaiseExceptionOrContinue() |
| 419 else: | 423 else: |
| 420 try: | 424 try: |
| 421 raise _InternalException('expectations_json_file %s not found' % | 425 raise _InternalException('expectations_json_file %s not found' % |
| 422 expectations_json_file) | 426 expectations_json_file) |
| 423 except: | 427 except: |
| 424 exception_handler.RaiseExceptionOrContinue() | 428 exception_handler.RaiseExceptionOrContinue() |
| 425 | 429 |
| 426 exception_handler.ReportAllFailures() | 430 exception_handler.ReportAllFailures() |
| OLD | NEW |