[go: nahoru, domu]

blob: 6e3c8863ce60c909a0bb28d82a2a2d67062cc2d2 [file] [log] [blame]
Peter Wen52efd31922018-01-31 22:04:521# Copyright 2018 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5"""Presubmit script for android buildbot.
6
7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
8details on the presubmit API built into depot_tools.
9"""
10
Keren Zhuafbefc92021-06-30 18:40:2011USE_PYTHON3 = True
12
Peter Wen52efd31922018-01-31 22:04:5213
14def CommonChecks(input_api, output_api):
15 base_android_jni_generator_dir = input_api.PresubmitLocalPath()
16
17 env = dict(input_api.environ)
18 env.update({
Eric Stevensond00e9a12019-05-22 15:55:1119 'PYTHONPATH': base_android_jni_generator_dir,
20 'PYTHONDONTWRITEBYTECODE': '1',
Peter Wen52efd31922018-01-31 22:04:5221 })
22
Andrew Grievede87fa012022-07-05 18:55:3723 return input_api.RunTests(
24 input_api.canned_checks.GetUnitTests(
25 input_api,
26 output_api,
27 run_on_python2=False,
28 unit_tests=[
29 input_api.os_path.join(base_android_jni_generator_dir,
30 'jni_generator_tests.py')
31 ],
32 env=env,
33 ))
Peter Wen52efd31922018-01-31 22:04:5234
35
36def CheckChangeOnUpload(input_api, output_api):
Eric Stevensond00e9a12019-05-22 15:55:1137 return CommonChecks(input_api, output_api)
Peter Wen52efd31922018-01-31 22:04:5238
39
40def CheckChangeOnCommit(input_api, output_api):
Eric Stevensond00e9a12019-05-22 15:55:1141 return CommonChecks(input_api, output_api)