xref: /aosp_15_r20/external/cronet/third_party/jni_zero/PRESUBMIT.py (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2018 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4"""Presubmit script for android buildbot.
5
6See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
7details on the presubmit API built into depot_tools.
8"""
9
10
11def CommonChecks(input_api, output_api):
12  base_android_jni_generator_dir = input_api.PresubmitLocalPath()
13
14  env = dict(input_api.environ)
15  env.update({
16      'PYTHONPATH': base_android_jni_generator_dir,
17      'PYTHONDONTWRITEBYTECODE': '1',
18  })
19
20  return input_api.RunTests(
21      input_api.canned_checks.GetUnitTests(
22          input_api,
23          output_api,
24          unit_tests=[
25              input_api.os_path.join(base_android_jni_generator_dir, 'test',
26                                     'integration_tests.py')
27          ],
28          env=env,
29      ))
30
31
32def CheckChangeOnUpload(input_api, output_api):
33  return CommonChecks(input_api, output_api)
34
35
36def CheckChangeOnCommit(input_api, output_api):
37  return CommonChecks(input_api, output_api)
38