PRESUBMIT.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. """Presubmit script for ios test runner 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 _RunTestRunnerUnitTests(input_api, output_api):
  10. # Don't run iOS tests on Windows.
  11. if input_api.is_windows:
  12. return []
  13. """ Runs iOS test runner unit tests """
  14. files = ['.*_test.py$']
  15. return input_api.canned_checks.RunUnitTestsInDirectory(
  16. input_api,
  17. output_api,
  18. '.',
  19. files_to_check=files,
  20. run_on_python2=not USE_PYTHON3,
  21. run_on_python3=USE_PYTHON3,
  22. skip_shebang_check=True)
  23. def CheckChange(input_api, output_api):
  24. results = []
  25. results.extend(_RunTestRunnerUnitTests(input_api, output_api))
  26. return results
  27. def CheckChangeOnCommit(input_api, output_api):
  28. return CheckChange(input_api, output_api)
  29. def CheckChangeOnUpload(input_api, output_api):
  30. return CheckChange(input_api, output_api)