| 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 from infra.libs.infra_types import freeze | 5 from infra.libs.infra_types import freeze |
| 6 | 6 |
| 7 DEPS = [ | 7 DEPS = [ |
| 8 'bot_update', | 8 'bot_update', |
| 9 'chromium', | 9 'chromium', |
| 10 'file', | 10 'file', |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 api.chromium.run_gn() | 81 api.chromium.run_gn() |
| 82 | 82 |
| 83 api.chromium.compile(targets=['gn', 'gn_unittests'], force_clobber=True) | 83 api.chromium.compile(targets=['gn', 'gn_unittests'], force_clobber=True) |
| 84 | 84 |
| 85 path_to_binary = str(api.path['checkout'].join('out', 'Release', 'gn')) | 85 path_to_binary = str(api.path['checkout'].join('out', 'Release', 'gn')) |
| 86 if api.platform.is_win: | 86 if api.platform.is_win: |
| 87 path_to_binary += '.exe' | 87 path_to_binary += '.exe' |
| 88 | 88 |
| 89 api.step('gn version', [path_to_binary, '--version']) | 89 api.step('gn version', [path_to_binary, '--version']) |
| 90 | 90 |
| 91 # TODO: crbug.com/443813 - if gn_unittests is run from any dir other | 91 api.chromium.runtest('gn_unittests', cwd=api.path['checkout']) |
| 92 # than the checkout root, it'll fail. Unfortunately, if runtest | |
| 93 # is run from any place other than the checkout root (the directory | |
| 94 # above api.path['checkout']), it computes the path to the binary | |
| 95 # incorrectly and fails to find it :(. | |
| 96 # api.chromium.runtest('gn_unittests', cwd=api.path['checkout']) | |
| 97 | 92 |
| 98 api.python('upload', | 93 api.python('upload', |
| 99 api.path['depot_tools'].join('upload_to_google_storage.py'), | 94 api.path['depot_tools'].join('upload_to_google_storage.py'), |
| 100 ['-b', 'chromium-gn', path_to_binary]) | 95 ['-b', 'chromium-gn', path_to_binary]) |
| 101 | 96 |
| 102 sha1 = api.file.read('gn sha1', path_to_binary + '.sha1', | 97 sha1 = api.file.read('gn sha1', path_to_binary + '.sha1', |
| 103 test_data='0123456789abcdeffedcba987654321012345678') | 98 test_data='0123456789abcdeffedcba987654321012345678') |
| 104 api.step.active_result.presentation.step_text = sha1 | 99 api.step.active_result.presentation.step_text = sha1 |
| 105 | 100 |
| 106 | 101 |
| 107 def GenTests(api): | 102 def GenTests(api): |
| 108 for test in api.chromium.gen_tests_for_builders(BUILDERS): | 103 for test in api.chromium.gen_tests_for_builders(BUILDERS): |
| 109 yield test | 104 yield test |
| OLD | NEW |