| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Exposes the builder and recipe configurations to GenTests in recipes. | 5 # Exposes the builder and recipe configurations to GenTests in recipes. |
| 6 | 6 |
| 7 import re | 7 import re |
| 8 | 8 |
| 9 from recipe_engine import recipe_test_api | 9 from recipe_engine import recipe_test_api |
| 10 from . import builders | 10 from . import builders |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 return self.override_step_data( | 418 return self.override_step_data( |
| 419 step_name, self.failures_example()) | 419 step_name, self.failures_example()) |
| 420 | 420 |
| 421 def stdout(self, step_name, output, retcode=0): | 421 def stdout(self, step_name, output, retcode=0): |
| 422 return self.override_step_data( | 422 return self.override_step_data( |
| 423 step_name, | 423 step_name, |
| 424 self.m.raw_io.stream_output(output, stream='stdout'), | 424 self.m.raw_io.stream_output(output, stream='stdout'), |
| 425 retcode=retcode, | 425 retcode=retcode, |
| 426 ) | 426 ) |
| 427 | 427 |
| 428 def stderr(self, step_name, output, retcode=0): | |
| 429 return self.override_step_data( | |
| 430 step_name, | |
| 431 self.m.raw_io.stream_output(output, stream='stderr'), | |
| 432 retcode=retcode, | |
| 433 ) | |
| 434 | |
| 435 @recipe_test_api.mod_test_data | 428 @recipe_test_api.mod_test_data |
| 436 @staticmethod | 429 @staticmethod |
| 437 def test_failures(has_failures): | 430 def test_failures(has_failures): |
| 438 return has_failures | 431 return has_failures |
| 439 | 432 |
| 440 @recipe_test_api.mod_test_data | 433 @recipe_test_api.mod_test_data |
| 441 @staticmethod | 434 @staticmethod |
| 442 def flakes(flakes): | 435 def flakes(flakes): |
| 443 return flakes | 436 return flakes |
| 444 | 437 |
| 445 @recipe_test_api.mod_test_data | 438 @recipe_test_api.mod_test_data |
| 446 @staticmethod | 439 @staticmethod |
| 447 def wrong_results(wrong_results): | 440 def wrong_results(wrong_results): |
| 448 return wrong_results | 441 return wrong_results |
| 449 | 442 |
| 450 @recipe_test_api.mod_test_data | 443 @recipe_test_api.mod_test_data |
| 451 @staticmethod | 444 @staticmethod |
| 452 def perf_failures(has_failures): | 445 def perf_failures(has_failures): |
| 453 return has_failures | 446 return has_failures |
| 454 | 447 |
| 455 def __call__(self, test_failures=False, wrong_results=False, | 448 def __call__(self, test_failures=False, wrong_results=False, |
| 456 perf_failures=False, flakes=False): | 449 perf_failures=False, flakes=False): |
| 457 return (self.test_failures(test_failures) + | 450 return (self.test_failures(test_failures) + |
| 458 self.wrong_results(wrong_results) + | 451 self.wrong_results(wrong_results) + |
| 459 self.flakes(flakes) + | 452 self.flakes(flakes) + |
| 460 self.perf_failures(perf_failures)) | 453 self.perf_failures(perf_failures)) |
| OLD | NEW |