| 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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 drop any failures that the sanitizers don't care about. | 964 drop any failures that the sanitizers don't care about. |
| 965 """ | 965 """ |
| 966 expected_results = expected_results.copy() | 966 expected_results = expected_results.copy() |
| 967 for result in (IMAGE, FAIL, IMAGE_PLUS_TEXT): | 967 for result in (IMAGE, FAIL, IMAGE_PLUS_TEXT): |
| 968 if result in expected_results: | 968 if result in expected_results: |
| 969 expected_results.remove(result) | 969 expected_results.remove(result) |
| 970 expected_results.add(PASS) | 970 expected_results.add(PASS) |
| 971 return expected_results | 971 return expected_results |
| 972 | 972 |
| 973 @staticmethod | 973 @staticmethod |
| 974 def has_pixel_failures(actual_results): | |
| 975 return IMAGE in actual_results or FAIL in actual_results | |
| 976 | |
| 977 @staticmethod | |
| 978 def suffixes_for_expectations(expectations): | 974 def suffixes_for_expectations(expectations): |
| 979 suffixes = set() | 975 suffixes = set() |
| 980 if IMAGE in expectations: | 976 if IMAGE in expectations: |
| 981 suffixes.add('png') | 977 suffixes.add('png') |
| 982 if FAIL in expectations: | 978 if FAIL in expectations: |
| 983 suffixes.add('txt') | 979 suffixes.add('txt') |
| 984 suffixes.add('png') | 980 suffixes.add('png') |
| 985 suffixes.add('wav') | 981 suffixes.add('wav') |
| 986 return set(suffixes) | 982 return set(suffixes) |
| 987 | 983 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1202 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
| 1207 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1203 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
| 1208 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1204 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
| 1209 return expectation_line.to_string(test_configuration_converter) | 1205 return expectation_line.to_string(test_configuration_converter) |
| 1210 return expectation_line.original_string | 1206 return expectation_line.original_string |
| 1211 | 1207 |
| 1212 def nones_out(expectation_line): | 1208 def nones_out(expectation_line): |
| 1213 return expectation_line is not None | 1209 return expectation_line is not None |
| 1214 | 1210 |
| 1215 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) | 1211 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) |
| OLD | NEW |