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 'filter', | 7 'filter', |
8 'json', | 8 'json', |
9 'path', | 9 'path', |
10 'properties', | 10 'properties', |
11 'raw_io', | 11 'raw_io', |
| 12 'step', |
12 ] | 13 ] |
13 | 14 |
14 def GenSteps(api): | 15 def GenSteps(api): |
15 api.path['checkout'] = api.path['slave_build'] | 16 api.path['checkout'] = api.path['slave_build'] |
16 api.chromium.set_config('chromium') | 17 api.chromium.set_config('chromium') |
17 api.filter.does_patch_require_compile() | 18 api.filter.does_patch_require_compile() |
18 assert (api.filter.result and api.properties['example_result']) or \ | 19 assert (api.filter.result and api.properties['example_result']) or \ |
19 (not api.filter.result and not api.properties['example_result']) | 20 (not api.filter.result and not api.properties['example_result']) |
20 assert (not api.properties['example_matching_exes'] or | 21 assert (not api.properties['example_matching_exes'] or |
21 list(api.properties['example_matching_exes']) == | 22 list(api.properties['example_matching_exes']) == |
22 api.filter.matching_exes) | 23 api.filter.matching_exes) |
| 24 api.step('hello', ['echo', 'Why hello, there.']) |
23 | 25 |
24 def GenTests(api): | 26 def GenTests(api): |
25 # Trivial test with no exclusions and nothing matching. | 27 # Trivial test with no exclusions and nothing matching. |
26 yield (api.test('basic') + | 28 yield (api.test('basic') + |
27 api.properties(filter_exclusions=[]) + | 29 api.properties(filter_exclusions=[]) + |
28 api.properties(example_result=None) + | 30 api.properties(example_result=None) + |
29 api.properties(example_matching_exes=None) + | 31 api.properties(example_matching_exes=None) + |
30 api.override_step_data( | 32 api.override_step_data( |
31 'git diff to analyze patch', | 33 'git diff to analyze patch', |
32 api.raw_io.stream_output('yy'))) | 34 api.raw_io.stream_output('yy'))) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 'targets': ['foo']}))) | 71 'targets': ['foo']}))) |
70 | 72 |
71 # Analyze with error condition. | 73 # Analyze with error condition. |
72 yield (api.test('analyzes_error') + | 74 yield (api.test('analyzes_error') + |
73 api.properties(matching_exes=None) + | 75 api.properties(matching_exes=None) + |
74 api.properties(example_matching_exes=None) + | 76 api.properties(example_matching_exes=None) + |
75 api.properties(example_result=1) + | 77 api.properties(example_result=1) + |
76 api.override_step_data( | 78 api.override_step_data( |
77 'analyze', | 79 'analyze', |
78 api.json.output({'error': 'ERROR'}))) | 80 api.json.output({'error': 'ERROR'}))) |
| 81 |
| 82 # Analyze with python returning bad status. |
| 83 yield (api.test('bad_retcode_doesnt_fail') + |
| 84 api.properties(matching_exes=None) + |
| 85 api.properties(example_matching_exes=None) + |
| 86 api.properties(example_result=1) + |
| 87 api.step_data( |
| 88 'analyze', |
| 89 retcode=-1)) |
OLD | NEW |