OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 from recipe_engine import recipe_api | 5 from recipe_engine import recipe_api |
6 from recipe_engine import util as recipe_util | 6 from recipe_engine import util as recipe_util |
7 | 7 |
8 from .util import GTestResults, TestResults | 8 from .util import GTestResults, TestResults |
9 | 9 |
10 # TODO(luqui): Destroy this DEPS hack. | 10 # TODO(luqui): Destroy this DEPS hack. |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 if new_failures: | 188 if new_failures: |
189 self.m.python.failing_step(step_name, step_text) | 189 self.m.python.failing_step(step_name, step_text) |
190 else: | 190 else: |
191 self.m.python.succeeding_step(step_name, step_text) | 191 self.m.python.succeeding_step(step_name, step_text) |
192 finally: | 192 finally: |
193 if new_failures: | 193 if new_failures: |
194 self.m.tryserver.set_test_failure_tryjob_result() | 194 self.m.tryserver.set_test_failure_tryjob_result() |
195 elif ignored_failures: | 195 elif ignored_failures: |
196 self.m.step.active_result.presentation.status = self.m.step.WARNING | 196 self.m.step.active_result.presentation.status = self.m.step.WARNING |
197 | 197 |
| 198 def create_results_from_json(self, data): |
| 199 return TestResults(data) |
| 200 |
198 @recipe_util.returns_placeholder | 201 @recipe_util.returns_placeholder |
199 def test_results(self, add_json_log=True): | 202 def test_results(self, add_json_log=True): |
200 """A placeholder which will expand to '/tmp/file'. | 203 """A placeholder which will expand to '/tmp/file'. |
201 | 204 |
202 The recipe must provide the expected --json-test-results flag. | 205 The recipe must provide the expected --json-test-results flag. |
203 | 206 |
204 The test_results will be an instance of the TestResults class. | 207 The test_results will be an instance of the TestResults class. |
205 """ | 208 """ |
206 return TestResultsOutputPlaceholder(self, add_json_log) | 209 return TestResultsOutputPlaceholder(self, add_json_log) |
207 | 210 |
208 @recipe_util.returns_placeholder | 211 @recipe_util.returns_placeholder |
209 def gtest_results(self, add_json_log=True): | 212 def gtest_results(self, add_json_log=True): |
210 """A placeholder which will expand to | 213 """A placeholder which will expand to |
211 '--test-launcher-summary-output=/tmp/file'. | 214 '--test-launcher-summary-output=/tmp/file'. |
212 | 215 |
213 Provides the --test-launcher-summary-output flag since --flag=value | 216 Provides the --test-launcher-summary-output flag since --flag=value |
214 (i.e. a single token in the command line) is the required format. | 217 (i.e. a single token in the command line) is the required format. |
215 | 218 |
216 The test_results will be an instance of the GTestResults class. | 219 The test_results will be an instance of the GTestResults class. |
217 """ | 220 """ |
218 return GTestResultsOutputPlaceholder(self, add_json_log) | 221 return GTestResultsOutputPlaceholder(self, add_json_log) |
219 | 222 |
OLD | NEW |