Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | # Copyright 2018 The Chromium Authors |
Peter Wen | 52efd3192 | 2018-01-31 22:04:52 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
Peter Wen | 52efd3192 | 2018-01-31 22:04:52 | [diff] [blame] | 4 | """Presubmit script for android buildbot. |
| 5 | |
| 6 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
| 7 | details on the presubmit API built into depot_tools. |
| 8 | """ |
| 9 | |
Sam Maier | b926c58c | 2023-08-08 19:58:25 | [diff] [blame] | 10 | |
Peter Wen | 52efd3192 | 2018-01-31 22:04:52 | [diff] [blame] | 11 | def CommonChecks(input_api, output_api): |
| 12 | base_android_jni_generator_dir = input_api.PresubmitLocalPath() |
| 13 | |
| 14 | env = dict(input_api.environ) |
| 15 | env.update({ |
Eric Stevenson | d00e9a1 | 2019-05-22 15:55:11 | [diff] [blame] | 16 | 'PYTHONPATH': base_android_jni_generator_dir, |
| 17 | 'PYTHONDONTWRITEBYTECODE': '1', |
Peter Wen | 52efd3192 | 2018-01-31 22:04:52 | [diff] [blame] | 18 | }) |
| 19 | |
Andrew Grieve | de87fa01 | 2022-07-05 18:55:37 | [diff] [blame] | 20 | return input_api.RunTests( |
| 21 | input_api.canned_checks.GetUnitTests( |
| 22 | input_api, |
| 23 | output_api, |
Andrew Grieve | de87fa01 | 2022-07-05 18:55:37 | [diff] [blame] | 24 | unit_tests=[ |
| 25 | input_api.os_path.join(base_android_jni_generator_dir, |
Andrew Grieve | a912bcac | 2023-07-18 17:24:09 | [diff] [blame] | 26 | 'integration_tests.py') |
Andrew Grieve | de87fa01 | 2022-07-05 18:55:37 | [diff] [blame] | 27 | ], |
| 28 | env=env, |
| 29 | )) |
Peter Wen | 52efd3192 | 2018-01-31 22:04:52 | [diff] [blame] | 30 | |
| 31 | |
| 32 | def CheckChangeOnUpload(input_api, output_api): |
Eric Stevenson | d00e9a1 | 2019-05-22 15:55:11 | [diff] [blame] | 33 | return CommonChecks(input_api, output_api) |
Peter Wen | 52efd3192 | 2018-01-31 22:04:52 | [diff] [blame] | 34 | |
| 35 | |
| 36 | def CheckChangeOnCommit(input_api, output_api): |
Eric Stevenson | d00e9a1 | 2019-05-22 15:55:11 | [diff] [blame] | 37 | return CommonChecks(input_api, output_api) |