• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 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 Fuchsia.
5
6See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
7details on the presubmit API built into depot_tools.
8"""
9
10USE_PYTHON3 = True
11
12import os
13
14
15def CommonChecks(input_api, output_api):
16  build_fuchsia_dir = input_api.PresubmitLocalPath()
17
18  def J(*dirs):
19    """Returns a path relative to presubmit directory."""
20    return input_api.os_path.join(build_fuchsia_dir, *dirs)
21
22  tests = []
23  unit_tests = [
24      J('binary_sizes_test.py'),
25      J('binary_size_differ_test.py'),
26      J('gcs_download_test.py'),
27      J('update_images_test.py'),
28      J('update_product_bundles_test.py'),
29      J('update_sdk_test.py'),
30  ]
31
32  tests.extend(
33      input_api.canned_checks.GetUnitTests(input_api,
34                                           output_api,
35                                           unit_tests=unit_tests,
36                                           run_on_python2=False,
37                                           run_on_python3=True,
38                                           skip_shebang_check=True))
39  return input_api.RunTests(tests)
40
41
42def CheckChangeOnUpload(input_api, output_api):
43  return CommonChecks(input_api, output_api)
44
45
46def CheckChangeOnCommit(input_api, output_api):
47  return CommonChecks(input_api, output_api)
48