OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 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 28 matching lines...) Expand all Loading... |
39 # FIXME: This is backwards. Each TestFailure subclass should know what | 39 # FIXME: This is backwards. Each TestFailure subclass should know what |
40 # test_expectation type it corresponds too. Then this method just | 40 # test_expectation type it corresponds too. Then this method just |
41 # collects them all from the failure list and returns the worst one. | 41 # collects them all from the failure list and returns the worst one. |
42 | 42 |
43 | 43 |
44 def determine_result_type(failure_list): | 44 def determine_result_type(failure_list): |
45 """Takes a set of test_failures and returns which result type best fits | 45 """Takes a set of test_failures and returns which result type best fits |
46 the list of failures. "Best fits" means we use the worst type of failure. | 46 the list of failures. "Best fits" means we use the worst type of failure. |
47 | 47 |
48 Returns: | 48 Returns: |
49 one of the test_expectations result types - PASS, FAIL, CRASH, etc.""" | 49 one of the test_expectations result types - PASS, FAIL, CRASH, etc. |
| 50 """ |
50 | 51 |
51 if not failure_list or len(failure_list) == 0: | 52 if not failure_list or len(failure_list) == 0: |
52 return test_expectations.PASS | 53 return test_expectations.PASS |
53 | 54 |
54 failure_types = [type(f) for f in failure_list] | 55 failure_types = [type(f) for f in failure_list] |
55 if FailureCrash in failure_types: | 56 if FailureCrash in failure_types: |
56 return test_expectations.CRASH | 57 return test_expectations.CRASH |
57 elif FailureLeak in failure_types: | 58 elif FailureLeak in failure_types: |
58 return test_expectations.LEAK | 59 return test_expectations.LEAK |
59 elif FailureTimeout in failure_types: | 60 elif FailureTimeout in failure_types: |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 # Convenient collection of all failure classes for anything that might | 251 # Convenient collection of all failure classes for anything that might |
251 # need to enumerate over them all. | 252 # need to enumerate over them all. |
252 ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult, | 253 ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult, |
253 FailureTestHarnessAssertion, | 254 FailureTestHarnessAssertion, |
254 FailureTextMismatch, FailureMissingImageHash, | 255 FailureTextMismatch, FailureMissingImageHash, |
255 FailureMissingImage, FailureImageHashMismatch, | 256 FailureMissingImage, FailureImageHashMismatch, |
256 FailureImageHashIncorrect, FailureReftestMismatch, | 257 FailureImageHashIncorrect, FailureReftestMismatch, |
257 FailureReftestMismatchDidNotOccur, FailureReftestNoImages
Generated, | 258 FailureReftestMismatchDidNotOccur, FailureReftestNoImages
Generated, |
258 FailureMissingAudio, FailureAudioMismatch, | 259 FailureMissingAudio, FailureAudioMismatch, |
259 FailureEarlyExit) | 260 FailureEarlyExit) |
OLD | NEW |