OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Generic presubmit checks that can be reused by other presubmit checks.""" | 5 """Generic presubmit checks that can be reused by other presubmit checks.""" |
6 | 6 |
7 import os as _os | 7 import os as _os |
8 _HERE = _os.path.dirname(_os.path.abspath(__file__)) | 8 _HERE = _os.path.dirname(_os.path.abspath(__file__)) |
9 | 9 |
10 | 10 |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 message_type = output_api.PresubmitPromptWarning | 531 message_type = output_api.PresubmitPromptWarning |
532 | 532 |
533 results = [] | 533 results = [] |
534 for unit_test in unit_tests: | 534 for unit_test in unit_tests: |
535 cmd = [] | 535 cmd = [] |
536 if input_api.platform == 'win32' and unit_test.endswith('.py'): | 536 if input_api.platform == 'win32' and unit_test.endswith('.py'): |
537 # Windows needs some help. | 537 # Windows needs some help. |
538 cmd = [input_api.python_executable] | 538 cmd = [input_api.python_executable] |
539 cmd.append(unit_test) | 539 cmd.append(unit_test) |
540 if input_api.verbose: | 540 if input_api.verbose: |
541 print('Running %s' % unit_test) | |
542 cmd.append('--verbose') | 541 cmd.append('--verbose') |
543 results.append(input_api.Command( | 542 results.append(input_api.Command( |
544 name=unit_test, | 543 name=unit_test, |
545 cmd=cmd, | 544 cmd=cmd, |
546 kwargs={'cwd': input_api.PresubmitLocalPath()}, | 545 kwargs={'cwd': input_api.PresubmitLocalPath()}, |
547 message=message_type)) | 546 message=message_type)) |
548 return results | 547 return results |
549 | 548 |
550 | 549 |
551 def GetPythonUnitTests(input_api, output_api, unit_tests): | 550 def GetPythonUnitTests(input_api, output_api, unit_tests): |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 snapshot("checking description") | 1022 snapshot("checking description") |
1024 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 1023 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
1025 input_api, output_api)) | 1024 input_api, output_api)) |
1026 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( | 1025 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( |
1027 input_api, output_api)) | 1026 input_api, output_api)) |
1028 snapshot("checking do not submit in files") | 1027 snapshot("checking do not submit in files") |
1029 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( | 1028 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( |
1030 input_api, output_api)) | 1029 input_api, output_api)) |
1031 snapshot("done") | 1030 snapshot("done") |
1032 return results | 1031 return results |
OLD | NEW |