forked from OSchip/llvm-project
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 llvm-svn: 280550
This commit is contained in:
parent
83849415de
commit
92bbf96c97
|
@ -1,5 +1,6 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import lit.Test
|
import lit.Test
|
||||||
|
@ -34,9 +35,10 @@ class GoogleTest(TestFormat):
|
||||||
if kIsWindows:
|
if kIsWindows:
|
||||||
lines = lines.replace('\r', '')
|
lines = lines.replace('\r', '')
|
||||||
lines = lines.split('\n')
|
lines = lines.split('\n')
|
||||||
except:
|
except Exception as exc:
|
||||||
litConfig.error("unable to discover google-tests in %r: %s"
|
out = exc.output if isinstance(exc, subprocess.CalledProcessError) else ''
|
||||||
% (path, sys.exc_info()[1]))
|
litConfig.error("unable to discover google-tests in %r: %s. Process output: %s"
|
||||||
|
% (path, sys.exc_info()[1], out))
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
|
|
||||||
nested_tests = []
|
nested_tests = []
|
||||||
|
@ -136,4 +138,3 @@ class GoogleTest(TestFormat):
|
||||||
return lit.Test.UNRESOLVED, msg
|
return lit.Test.UNRESOLVED, msg
|
||||||
|
|
||||||
return lit.Test.PASS,''
|
return lit.Test.PASS,''
|
||||||
|
|
||||||
|
|
|
@ -69,9 +69,13 @@ def capture(args, env=None):
|
||||||
exits with a non-zero status."""
|
exits with a non-zero status."""
|
||||||
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
env=env)
|
env=env)
|
||||||
out,_ = p.communicate()
|
out, err = p.communicate()
|
||||||
|
out = convert_string(out)
|
||||||
|
err = convert_string(err)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise subprocess.CalledProcessError(cmd=args, returncode=p.returncode)
|
raise subprocess.CalledProcessError(cmd=args,
|
||||||
|
returncode=p.returncode,
|
||||||
|
output="{}\n{}".format(out, err))
|
||||||
return convert_string(out)
|
return convert_string(out)
|
||||||
|
|
||||||
def which(command, paths = None):
|
def which(command, paths = None):
|
||||||
|
|
Loading…
Reference in New Issue