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.recipe_api import Property | 5 from recipe_engine.recipe_api import Property |
6 | 6 |
7 DEPS = [ | 7 DEPS = [ |
8 'generator_script', | 8 'generator_script', |
9 'json', | 9 'json', |
10 'path', | 10 'path', |
11 'properties', | 11 'properties', |
12 'step', | 12 'step', |
13 ] | 13 ] |
14 | 14 |
15 PROPERTIES = { | 15 PROPERTIES = { |
16 'script_name': Property(kind=str), | 16 'script_name': Property(kind=str), |
17 'script_env': Property(default=None, kind=dict), | 17 'script_env': Property(default=None, kind=dict), |
18 } | 18 } |
19 | 19 |
20 def RunSteps(api, script_name, script_env): | 20 def RunSteps(api, script_name, script_env): |
21 api.path['checkout'] = api.path['slave_build'] | 21 api.path['checkout'] = api.path['tmp'].join('checkout') |
22 script_name = api.properties['script_name'] | 22 script_name = api.properties['script_name'] |
23 script_env = api.properties.get('script_env') | 23 script_env = api.properties.get('script_env') |
24 api.generator_script(script_name, env=script_env) | 24 api.generator_script(script_name, env=script_env) |
25 | 25 |
26 def GenTests(api): | 26 def GenTests(api): |
27 yield ( | 27 yield ( |
28 api.test('basic') + | 28 api.test('basic') + |
29 api.properties(script_name="bogus") + | 29 api.properties(script_name="bogus") + |
30 api.generator_script( | 30 api.generator_script( |
31 'bogus', | 31 'bogus', |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 ) | 73 ) |
74 | 74 |
75 yield ( | 75 yield ( |
76 api.test('malformed_command') + | 76 api.test('malformed_command') + |
77 api.properties(script_name='malformed.py') + | 77 api.properties(script_name='malformed.py') + |
78 api.generator_script( | 78 api.generator_script( |
79 'malformed.py', | 79 'malformed.py', |
80 {'name': 'run', 'cmd': ['echo', 'there are', 4, 'cows']}) + | 80 {'name': 'run', 'cmd': ['echo', 'there are', 4, 'cows']}) + |
81 api.expect_exception('AssertionError') | 81 api.expect_exception('AssertionError') |
82 ) | 82 ) |
OLD | NEW |