| # Copyright 2017 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| """Recipe for building Isolate Test.""" |
| |
| from recipe_engine.recipe_api import Property |
| from recipe_engine import config |
| |
| |
| DEPS = [ |
| 'infra/jiri', |
| 'recipe_engine/path', |
| 'recipe_engine/properties', |
| 'recipe_engine/step', |
| ] |
| |
| PROPERTIES = { |
| 'category': Property(kind=str, help='Build category', default=None), |
| 'patch_gerrit_url': Property(kind=str, help='Gerrit host', default=None), |
| 'patch_project': Property(kind=str, help='Gerrit project', default=None), |
| 'patch_ref': Property(kind=str, help='Gerrit patch ref', default=None), |
| 'patch_storage': Property(kind=str, help='Patch location', default=None), |
| 'patch_repository_url': Property(kind=str, help='URL to a Git repository', |
| default=None), |
| 'manifest': Property(kind=str, help='Jiri manifest to use'), |
| 'remote': Property(kind=str, help='Remote manifest repository'), |
| } |
| |
| |
| def RunSteps(api, category, patch_gerrit_url, patch_project, patch_ref, |
| patch_storage, patch_repository_url, manifest, remote): |
| api.jiri.ensure_jiri() |
| |
| api.jiri.init() |
| api.jiri.import_manifest(manifest, remote) |
| api.jiri.update() |
| if patch_ref is not None: |
| api.jiri.patch(patch_ref, host=patch_gerrit_url) |
| |
| assert 'checkout' not in api.path |
| api.path['checkout'] = api.path['start_dir'].join('isolate-test') |
| buildtools_path = api.path['start_dir'].join('buildtools') |
| out_path = api.path['start_dir'].join('out', 'Default') |
| |
| with api.step.nest('build'): |
| api.step('gen', [buildtools_path.join('gn'), 'gen', out_path, |
| '--root=%s' % api.path['start_dir'], |
| '--dotfile=%s' % api.path['checkout'].join('.gn')]) |
| api.step('build', [buildtools_path.join('ninja'), '-C', out_path]) |
| |
| api.step('test', [out_path.join('host_x64', 'factorial_test')]) |
| |
| |
| def GenTests(api): |
| yield api.test('ci') + api.properties( |
| manifest='default', |
| remote='https://fuchsia.googlesource.com/playground/isolate-test', |
| ) |
| yield api.test('cq_try') + api.properties.tryserver( |
| gerrit_project='playground/isolate-test', |
| patch_gerrit_url='fuchsia-review.googlesource.com', |
| manifest='default', |
| remote='https://fuchsia.googlesource.com/playground/isolate-test', |
| ) |