PRESUBMIT.py 808 B

12345678910111213141516171819202122232425262728
  1. # Copyright (c) 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. """Presubmit script for changes affecting //build/lacros"""
  5. USE_PYTHON3 = True
  6. def _CommonChecks(input_api, output_api):
  7. # Don't run lacros tests on Windows.
  8. if input_api.is_windows:
  9. return []
  10. tests = input_api.canned_checks.GetUnitTestsInDirectory(
  11. input_api,
  12. output_api,
  13. '.', [r'^.+_test\.py$'],
  14. run_on_python2=False,
  15. run_on_python3=True,
  16. skip_shebang_check=True)
  17. return input_api.RunTests(tests)
  18. def CheckChangeOnUpload(input_api, output_api):
  19. return _CommonChecks(input_api, output_api)
  20. def CheckChangeOnCommit(input_api, output_api):
  21. return _CommonChecks(input_api, output_api)