Author: alexfh
Date: Wed Sep 30 05:41:53 2015
New Revision: 248886

URL: http://llvm.org/viewvc/llvm-project?rev=248886&view=rev
Log:
[clang-tidy] Better diagnostic in tests when clang-tidy fails.

Modified:
    clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.py

Modified: clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.py
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.py?rev=248886&r1=248885&r2=248886&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.py (original)
+++ clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.py Wed Sep 30 
05:41:53 2015
@@ -73,8 +73,12 @@ def main():
   args = ['clang-tidy', temp_file_name, '-fix', '--checks=-*,' + check_name] + 
\
         clang_tidy_extra_args
   print('Running ' + repr(args) + '...')
-  clang_tidy_output = \
-      subprocess.check_output(args, stderr=subprocess.STDOUT).decode()
+  try:
+    clang_tidy_output = \
+        subprocess.check_output(args, stderr=subprocess.STDOUT).decode()
+  except subprocess.CalledProcessError as e:
+    print('clang-tidy failed:\n' + e.output.decode())
+    raise
 
   print('------------------------ clang-tidy output -----------------------\n' 
+
         clang_tidy_output +


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to