[clang-tidy] Better diagnostic in tests when clang-tidy fails.

llvm-svn: 248886
This commit is contained in:
Alexander Kornienko 2015-09-30 10:41:53 +00:00
parent f03d2b4d1c
commit 42e651fa43
1 changed files with 6 additions and 2 deletions

View File

@ -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 +