| # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file |
| # for details. All rights reserved. Use of this source code is governed by a |
| # BSD-style license that can be found in the LICENSE file. |
| |
| from recipe_engine import post_process |
| |
| from PB.recipe_modules.dart.build.build import Build |
| |
| DEPS = [ |
| 'build', |
| 'recipe_engine/properties', |
| 'recipe_engine/step', |
| ] |
| |
| |
| def RunSteps(api): |
| gn_args = ['--super-fast'] |
| api.build.gn(name='gn it', args=gn_args) |
| |
| |
| def GenTests(api): |
| yield api.test( |
| 'success', |
| api.post_process(post_process.StatusSuccess), |
| ) |
| |
| yield api.test( |
| 'no-goma', |
| api.properties(**{'$dart/build': Build(disable_goma=True)}), |
| api.post_process(post_process.StepCommandContains, 'gn it', [ |
| '--super-fast', |
| '--no-goma', |
| ]), |
| api.post_process(post_process.DoesNotRunRE, '.*goma.*'), |
| api.post_process(post_process.StatusSuccess), |
| ) |
| |
| yield api.test( |
| 'fail', |
| api.step_data('gn it', retcode=1), |
| api.post_process(post_process.StatusFailure), |
| ) |