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 """Top-level presubmit script for depot tools. | 5 """Top-level presubmit script for depot tools. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
8 details on the presubmit API built into depot_tools. | 8 details on the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 server = local_rietveld.LocalRietveld() | 79 server = local_rietveld.LocalRietveld() |
80 finally: | 80 finally: |
81 sys.path = old_sys_path | 81 sys.path = old_sys_path |
82 | 82 |
83 results = [] | 83 results = [] |
84 try: | 84 try: |
85 # Start a local rietveld instance to test against. | 85 # Start a local rietveld instance to test against. |
86 server.start_server() | 86 server.start_server() |
87 test_path = input_api.os_path.abspath( | 87 test_path = input_api.os_path.abspath( |
88 input_api.os_path.join(input_api.PresubmitLocalPath(), 'tests')) | 88 input_api.os_path.join(input_api.PresubmitLocalPath(), 'tests')) |
| 89 |
| 90 # test-lib.sh is not an actual test so it should not be run. |
| 91 NON_TEST_FILES = ('test-lib.sh') |
89 for test in input_api.os_listdir(test_path): | 92 for test in input_api.os_listdir(test_path): |
90 # test-lib.sh is not an actual test so it should not be run. The other | 93 if test in NON_TEST_FILES or not test.endswith('.sh'): |
91 # tests are tests known to fail. | |
92 DISABLED_TESTS = ( | |
93 'owners.sh', 'push-from-logs.sh', 'rename.sh', 'test-lib.sh') | |
94 if test in DISABLED_TESTS or not test.endswith('.sh'): | |
95 continue | 94 continue |
96 | 95 |
97 print('Running %s' % test) | 96 print('Running %s' % test) |
98 try: | 97 try: |
99 if input_api.verbose: | 98 if input_api.verbose: |
100 input_api.subprocess.check_call( | 99 input_api.subprocess.check_call( |
101 [input_api.os_path.join(test_path, test)], cwd=test_path) | 100 [input_api.os_path.join(test_path, test)], cwd=test_path) |
102 else: | 101 else: |
103 input_api.subprocess.check_output( | 102 input_api.subprocess.check_output( |
104 [input_api.os_path.join(test_path, test)], cwd=test_path, | 103 [input_api.os_path.join(test_path, test)], cwd=test_path, |
(...skipping 19 matching lines...) Expand all Loading... |
124 | 123 |
125 | 124 |
126 def CheckChangeOnCommit(input_api, output_api): | 125 def CheckChangeOnCommit(input_api, output_api): |
127 output = [] | 126 output = [] |
128 output.extend(CommonChecks(input_api, output_api, [])) | 127 output.extend(CommonChecks(input_api, output_api, [])) |
129 output.extend(input_api.canned_checks.CheckDoNotSubmit( | 128 output.extend(input_api.canned_checks.CheckDoNotSubmit( |
130 input_api, | 129 input_api, |
131 output_api)) | 130 output_api)) |
132 output.extend(RunGitClTests(input_api, output_api)) | 131 output.extend(RunGitClTests(input_api, output_api)) |
133 return output | 132 return output |
OLD | NEW |