llvm.org GIT mirror llvm / 0c194fe
lit: print process output, if getting the list of google-tests failed. Summary: This is a follow up to r280455, where a check for the process exit code was introduced. Some ASAN bots throw this error now, but it's impossible to understand what's wrong with them, and the issue is not reproducible. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D24210 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280550 91177308-0d34-0410-b5e6-96231b3b80d8 Ivan Krasin 3 years ago
2 changed file(s) with 11 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
0 from __future__ import absolute_import
11 import os
2 import subprocess
23 import sys
34
45 import lit.Test
3334 if kIsWindows:
3435 lines = lines.replace('\r', '')
3536 lines = lines.split('\n')
36 except:
37 litConfig.error("unable to discover google-tests in %r: %s"
38 % (path, sys.exc_info()[1]))
37 except Exception as exc:
38 out = exc.output if isinstance(exc, subprocess.CalledProcessError) else ''
39 litConfig.error("unable to discover google-tests in %r: %s. Process output: %s"
40 % (path, sys.exc_info()[1], out))
3941 raise StopIteration
4042
4143 nested_tests = []
135137 return lit.Test.UNRESOLVED, msg
136138
137139 return lit.Test.PASS,''
138
6868 exits with a non-zero status."""
6969 p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
7070 env=env)
71 out,_ = p.communicate()
71 out, err = p.communicate()
72 out = convert_string(out)
73 err = convert_string(err)
7274 if p.returncode != 0:
73 raise subprocess.CalledProcessError(cmd=args, returncode=p.returncode)
75 raise subprocess.CalledProcessError(cmd=args,
76 returncode=p.returncode,
77 output="{}\n{}".format(out, err))
7478 return convert_string(out)
7579
7680 def which(command, paths = None):