OLD | NEW |
1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 test_name = self._test_name | 105 test_name = self._test_name |
106 else: | 106 else: |
107 test_name = test_base | 107 test_name = test_base |
108 args = self._port.lookup_virtual_test_args(self._test_name) | 108 args = self._port.lookup_virtual_test_args(self._test_name) |
109 else: | 109 else: |
110 test_name = self._test_name | 110 test_name = self._test_name |
111 args = self._port.lookup_physical_test_args(self._test_name) | 111 args = self._port.lookup_physical_test_args(self._test_name) |
112 return DriverInput(test_name, self._timeout, image_hash, self._should_ru
n_pixel_test, args) | 112 return DriverInput(test_name, self._timeout, image_hash, self._should_ru
n_pixel_test, args) |
113 | 113 |
114 def run(self): | 114 def run(self): |
| 115 if self._options.enable_sanitizer: |
| 116 return self._run_sanitized_test() |
115 if self._reference_files: | 117 if self._reference_files: |
116 if self._options.reset_results: | 118 if self._options.reset_results: |
117 reftest_type = set([reference_file[0] for reference_file in self
._reference_files]) | 119 reftest_type = set([reference_file[0] for reference_file in self
._reference_files]) |
118 result = TestResult(self._test_name, reftest_type=reftest_type) | 120 result = TestResult(self._test_name, reftest_type=reftest_type) |
119 result.type = test_expectations.SKIP | 121 result.type = test_expectations.SKIP |
120 return result | 122 return result |
121 return self._run_reftest() | 123 return self._run_reftest() |
122 if self._options.reset_results: | 124 if self._options.reset_results: |
123 return self._run_rebaseline() | 125 return self._run_rebaseline() |
124 return self._run_compare_test() | 126 return self._run_compare_test() |
125 | 127 |
| 128 def _run_sanitized_test(self): |
| 129 # running a sanitized test means that we ignore the actual test output a
nd just look |
| 130 # for timeouts and crashes (real or forced by the driver). Most crashes
should |
| 131 # indicate problems found by a sanitizer (ASAN, LSAN, etc.), but we will
report |
| 132 # on other crashes and timeouts as well in order to detect at least *som
e* basic failures. |
| 133 driver_output = self._driver.run_test(self._driver_input(), self._stop_w
hen_done) |
| 134 failures = self._handle_error(driver_output) |
| 135 return TestResult(self._test_name, failures, driver_output.test_time, dr
iver_output.has_stderr(), |
| 136 pid=driver_output.pid) |
| 137 |
126 def _run_compare_test(self): | 138 def _run_compare_test(self): |
127 driver_output = self._driver.run_test(self._driver_input(), self._stop_w
hen_done) | 139 driver_output = self._driver.run_test(self._driver_input(), self._stop_w
hen_done) |
128 expected_driver_output = self._expected_driver_output() | 140 expected_driver_output = self._expected_driver_output() |
129 | 141 |
130 test_result = self._compare_output(expected_driver_output, driver_output
) | 142 test_result = self._compare_output(expected_driver_output, driver_output
) |
131 if self._should_add_missing_baselines: | 143 if self._should_add_missing_baselines: |
132 self._add_missing_baselines(test_result, driver_output) | 144 self._add_missing_baselines(test_result, driver_output) |
133 test_result_writer.write_test_result(self._filesystem, self._port, self.
_results_directory, self._test_name, driver_output, expected_driver_output, test
_result.failures) | 145 test_result_writer.write_test_result(self._filesystem, self._port, self.
_results_directory, self._test_name, driver_output, expected_driver_output, test
_result.failures) |
134 return test_result | 146 return test_result |
135 | 147 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 elif reference_driver_output.image_hash != actual_driver_output.image_ha
sh: | 427 elif reference_driver_output.image_hash != actual_driver_output.image_ha
sh: |
416 diff, err_str = self._port.diff_image(reference_driver_output.image,
actual_driver_output.image) | 428 diff, err_str = self._port.diff_image(reference_driver_output.image,
actual_driver_output.image) |
417 if diff: | 429 if diff: |
418 failures.append(test_failures.FailureReftestMismatch(reference_f
ilename)) | 430 failures.append(test_failures.FailureReftestMismatch(reference_f
ilename)) |
419 elif err_str: | 431 elif err_str: |
420 _log.error(err_str) | 432 _log.error(err_str) |
421 else: | 433 else: |
422 _log.warning(" %s -> ref test hashes didn't match but diff pass
ed" % self._test_name) | 434 _log.warning(" %s -> ref test hashes didn't match but diff pass
ed" % self._test_name) |
423 | 435 |
424 return TestResult(self._test_name, failures, total_test_time, has_stderr
, pid=actual_driver_output.pid) | 436 return TestResult(self._test_name, failures, total_test_time, has_stderr
, pid=actual_driver_output.pid) |
OLD | NEW |