summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-04 17:30:40 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-04 17:30:40 +0000
commitb7cb09b01da36c479dce35d0cedde8392bd5e9cd (patch)
tree8824dba37605a3f0b78fccbb48d4ea1038076500 /tools
parentdf191bff763a7a833e05ff5843c0fcc719fd1ee2 (diff)
downloadchromium_src-b7cb09b01da36c479dce35d0cedde8392bd5e9cd.zip
chromium_src-b7cb09b01da36c479dce35d0cedde8392bd5e9cd.tar.gz
chromium_src-b7cb09b01da36c479dce35d0cedde8392bd5e9cd.tar.bz2
Return a non-zero exit code if compiler invocations failed.
This makes test_tool.py a little more user-friendly as a compile error in a test source file will actually display now. BUG= Review URL: https://codereview.chromium.org/13607002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192356 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/clang/scripts/run_tool.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/clang/scripts/run_tool.py b/tools/clang/scripts/run_tool.py
index 6eed3ca..597c825 100755
--- a/tools/clang/scripts/run_tool.py
+++ b/tools/clang/scripts/run_tool.py
@@ -144,6 +144,10 @@ class _CompilerDispatcher(object):
def edits(self):
return self.__edits
+ @property
+ def failed_count(self):
+ return self.__failed_count
+
def Run(self):
"""Does the grunt work."""
pool = multiprocessing.Pool()
@@ -260,7 +264,7 @@ def main(argv):
print ' <clang tool> is the clang tool that should be run.'
print ' <compile db> is the directory that contains the compile database'
print ' <path 1> <path2> ... can be used to filter what files are edited'
- sys.exit(1)
+ return 1
filenames = frozenset(_GetFilesFromGit(argv[2:]))
# Filter out files that aren't C/C++/Obj-C/Obj-C++.
@@ -276,6 +280,9 @@ def main(argv):
if k in filenames})
# TODO(dcheng): Consider clang-formatting the result to avoid egregious style
# violations.
+ if dispatcher.failed_count != 0:
+ return 2
+ return 0
if __name__ == '__main__':