PRESUBMIT.py 969 B

123456789101112131415161718192021222324252627282930313233
  1. # Copyright 2020 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. """Top-level presubmit script for dependency_analysis.
  5. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
  6. for more details on the presubmit API built into depot_tools.
  7. """
  8. USE_PYTHON3 = True
  9. def CommonChecks(input_api, output_api):
  10. checks = input_api.canned_checks.GetUnitTestsRecursively(
  11. input_api,
  12. output_api,
  13. input_api.PresubmitLocalPath(),
  14. files_to_check=[r'.+_unittest\.py$'],
  15. files_to_skip=[],
  16. run_on_python2=False,
  17. run_on_python3=True,
  18. skip_shebang_check=True)
  19. return input_api.RunTests(checks, False)
  20. def CheckChangeOnUpload(input_api, output_api):
  21. return CommonChecks(input_api, output_api)
  22. def CheckChangeOnCommit(input_api, output_api):
  23. return CommonChecks(input_api, output_api)