| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 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 |
| 5 """Script that runs tests before uploading a patch.""" |
| 6 |
| 7 |
| 8 def _RunTests(input_api, output_api): |
| 9 """Runs all test files in the directory.""" |
| 10 cmd_name = 'all_python_tests' |
| 11 cmd = ['python', '-m', 'unittest', 'discover', '-p', '*test.py'] |
| 12 test_cmd = input_api.Command( |
| 13 name=cmd_name, |
| 14 cmd=cmd, |
| 15 kwargs={}, |
| 16 message=output_api.PresubmitError) |
| 17 if input_api.verbose: |
| 18 print 'Running ' + cmd_name |
| 19 return input_api.RunTests([test_cmd]) |
| 20 |
| 21 |
| 22 def CheckChangeOnUpload(input_api, output_api): |
| 23 return _RunTests(input_api, output_api) |
| 24 |
| 25 |
| 26 def CheckChangeOnCommit(input_api, output_api): |
| 27 return _RunTests(input_api, output_api) |
| OLD | NEW |