Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 'infra_paths', | 6 'infra_paths', |
| 7 'recipe_engine/path', | |
| 7 'recipe_engine/platform', | 8 'recipe_engine/platform', |
| 8 'recipe_engine/properties', | 9 'recipe_engine/properties', |
| 9 'recipe_engine/step', | 10 'recipe_engine/step', |
| 10 ] | 11 ] |
| 11 | 12 |
| 12 from recipe_engine.config_types import Path | 13 from recipe_engine.config_types import Path |
| 13 | 14 |
| 14 def RunSteps(api): | 15 def RunSteps(api): |
| 15 api.step('step', [], cwd=api.infra_paths['slave_build']) | 16 api.step('step', [], cwd=api.infra_paths['slave_build']) |
| 16 | 17 |
| 18 if api.path.exists(api.infra_paths['slave_build'].join('foo.txt')): | |
| 19 api.step('path exists', []) | |
|
Michael Achenbach
2016/04/26 13:22:23
Maybe also demonstrate a path that doesn't exist.
Paweł Hajdan Jr.
2016/04/26 13:23:25
We do. We have tests (*_kitchen) where it doesn't
Michael Achenbach
2016/04/26 13:26:09
Fair enough. An "does not exist" line would also s
| |
| 20 | |
| 17 | 21 |
| 18 def GenTests(api): | 22 def GenTests(api): |
| 19 for platform in ('linux', 'win', 'mac'): | 23 for platform in ('linux', 'win', 'mac'): |
| 20 yield (api.test(platform) + api.platform.name(platform)) | 24 yield (api.test(platform) + |
| 25 api.platform.name(platform) + | |
| 26 api.infra_paths.exists( | |
| 27 api.infra_paths['slave_build'].join('foo.txt'))) | |
| 21 | 28 |
| 22 yield (api.test('%s_kitchen' % platform) + | 29 yield (api.test('%s_kitchen' % platform) + |
| 23 api.platform.name(platform) + | 30 api.platform.name(platform) + |
| 24 api.properties(path_config='kitchen')) | 31 api.properties(path_config='kitchen')) |
| OLD | NEW |