PRESUBMIT.py 883 B

1234567891011121314151617181920212223242526272829
  1. # Copyright 2015 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 testing/trigger_scripts.
  5. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
  6. for more details about the presubmit API built into depot_tools.
  7. """
  8. USE_PYTHON3 = True
  9. def CommonChecks(input_api, output_api):
  10. return input_api.canned_checks.RunUnitTestsInDirectory(
  11. input_api,
  12. output_api,
  13. '.',
  14. files_to_check=['.*test.py'],
  15. run_on_python2=not USE_PYTHON3,
  16. run_on_python3=USE_PYTHON3,
  17. skip_shebang_check=True)
  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)