OLD | NEW |
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2010 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 gcl. | 8 details on the presubmit API built into gcl. |
9 """ | 9 """ |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 """Run all the shells scripts in the directory test. | 21 """Run all the shells scripts in the directory test. |
22 """ | 22 """ |
23 # Not exposed from InputApi. | 23 # Not exposed from InputApi. |
24 from os import listdir | 24 from os import listdir |
25 | 25 |
26 # First loads a local Rietveld instance. | 26 # First loads a local Rietveld instance. |
27 import sys | 27 import sys |
28 old_sys_path = sys.path | 28 old_sys_path = sys.path |
29 try: | 29 try: |
30 sys.path = [input_api.PresubmitLocalPath()] + sys.path | 30 sys.path = [input_api.PresubmitLocalPath()] + sys.path |
31 from test import local_rietveld | 31 from test import local_rietveld # pylint: disable=W0403 |
32 server = local_rietveld.LocalRietveld() | 32 server = local_rietveld.LocalRietveld() |
33 finally: | 33 finally: |
34 sys.path = old_sys_path | 34 sys.path = old_sys_path |
35 | 35 |
36 # Set to True for testing. | 36 # Set to True for testing. |
37 verbose = False | 37 verbose = False |
38 if verbose: | 38 if verbose: |
39 stdout = None | 39 stdout = None |
40 stderr = None | 40 stderr = None |
41 else: | 41 else: |
(...skipping 19 matching lines...) Expand all Loading... |
61 stdout=stdout, | 61 stdout=stdout, |
62 stderr=stderr) | 62 stderr=stderr) |
63 proc.communicate() | 63 proc.communicate() |
64 if proc.returncode != 0: | 64 if proc.returncode != 0: |
65 output.append(output_api.PresubmitError('%s failed' % test)) | 65 output.append(output_api.PresubmitError('%s failed' % test)) |
66 except local_rietveld.Failure, e: | 66 except local_rietveld.Failure, e: |
67 output.append(output_api.PresubmitError('\n'.join(str(i) for i in e.args))) | 67 output.append(output_api.PresubmitError('\n'.join(str(i) for i in e.args))) |
68 finally: | 68 finally: |
69 server.stop_server() | 69 server.stop_server() |
70 return output | 70 return output |
OLD | NEW |