| 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 DEPS = [ | 5 DEPS = [ |
| 6 'chromium', | 6 'chromium', |
| 7 'isolate', | 7 'isolate', |
| 8 'json', | 8 'json', |
| 9 'path', | 9 'path', |
| 10 'properties', | 10 'properties', |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 # TODO(vadimsh): This step doesn't actually make any sense when the recipe | 33 # TODO(vadimsh): This step doesn't actually make any sense when the recipe |
| 34 # is running for real via run_recipe.py. | 34 # is running for real via run_recipe.py. |
| 35 api.isolate.find_isolated_tests(api.path['build'], expected_targets) | 35 api.isolate.find_isolated_tests(api.path['build'], expected_targets) |
| 36 | 36 |
| 37 # Code coverage for 'isolate_tests'. 'isolated_test' doesn't support discovery | 37 # Code coverage for 'isolate_tests'. 'isolated_test' doesn't support discovery |
| 38 # of isolated targets in build directory, so skip if 'expected_targets' is | 38 # of isolated targets in build directory, so skip if 'expected_targets' is |
| 39 # None. | 39 # None. |
| 40 if expected_targets is not None: | 40 if expected_targets is not None: |
| 41 api.isolate.isolate_tests(api.path['build'], expected_targets) | 41 api.isolate.isolate_tests(api.path['build'], expected_targets) |
| 42 | 42 |
| 43 # Code coverage for 'run_isolated'. | |
| 44 # TODO(phajdan.jr): Remove once used by other recipes. | |
| 45 api.isolate.run_isolated( | |
| 46 'base_unittests', | |
| 47 '7b28d637ab6bb2516584c21e1098736682457f11', | |
| 48 args=['--foo']) | |
| 49 | |
| 50 | 43 |
| 51 def GenTests(api): | 44 def GenTests(api): |
| 52 def make_test(name, expected_targets, discovered_targets): | 45 def make_test(name, expected_targets, discovered_targets): |
| 53 missing = set(expected_targets or []) - set(discovered_targets or []) | 46 missing = set(expected_targets or []) - set(discovered_targets or []) |
| 54 output = ( | 47 output = ( |
| 55 api.test(name) + | 48 api.test(name) + |
| 56 api.step_data( | 49 api.step_data( |
| 57 'read test spec', stdout=api.json.output(expected_targets)) + | 50 'read test spec', stdout=api.json.output(expected_targets)) + |
| 58 api.override_step_data( | 51 api.override_step_data( |
| 59 'find isolated tests', api.isolate.output_json(discovered_targets)) | 52 'find isolated tests', api.isolate.output_json(discovered_targets)) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 70 # No expectations, just discovering what's there returned by default mock. | 63 # No expectations, just discovering what's there returned by default mock. |
| 71 yield make_test('discover', None, None) | 64 yield make_test('discover', None, None) |
| 72 # Found more than expected. | 65 # Found more than expected. |
| 73 yield make_test('extra', ['test1', 'test2'], ['test1', 'test2', 'extra_test']) | 66 yield make_test('extra', ['test1', 'test2'], ['test1', 'test2', 'extra_test']) |
| 74 # Didn't find something. | 67 # Didn't find something. |
| 75 yield ( | 68 yield ( |
| 76 make_test('missing', ['test1', 'test2'], ['test1']) + | 69 make_test('missing', ['test1', 'test2'], ['test1']) + |
| 77 api.properties.generic(buildername='Windows Swarm Test')) | 70 api.properties.generic(buildername='Windows Swarm Test')) |
| 78 # No expectations, and nothing has been found, produces warning. | 71 # No expectations, and nothing has been found, produces warning. |
| 79 yield make_test('none', None, []) | 72 yield make_test('none', None, []) |
| OLD | NEW |