summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2018-12-14 22:38:01 +0000
committerMichal Gorny <mgorny@gentoo.org>2018-12-14 22:38:01 +0000
commitfbed4e1dcfebd154439de22a0b8461e04266672a (patch)
tree40e8de48488a50a980d26022bd44ca954a55a0bb
parent61c127c1ad9f7e415e00e449d8f52af54896c007 (diff)
downloadbcm5719-llvm-fbed4e1dcfebd154439de22a0b8461e04266672a.tar.gz
bcm5719-llvm-fbed4e1dcfebd154439de22a0b8461e04266672a.zip
[test] Capture stderr from 'tar --version' call as well
Capture the stderr from 'tar --version' call as otherwise error messages spill onto user's terminal unnecessarily (e.g. on NetBSD where tar does not support long options). While at it, refactor the code to use communicate() instead of reinventing the wheel. Differential Revision: https://reviews.llvm.org/D55443 llvm-svn: 349204
-rw-r--r--lld/test/lit.cfg.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lld/test/lit.cfg.py b/lld/test/lit.cfg.py
index d4d9ea74efa..9989a1cc97a 100644
--- a/lld/test/lit.cfg.py
+++ b/lld/test/lit.cfg.py
@@ -94,7 +94,10 @@ if config.have_dia_sdk:
tar_executable = lit.util.which('tar', config.environment['PATH'])
if tar_executable:
tar_version = subprocess.Popen(
- [tar_executable, '--version'], stdout=subprocess.PIPE, env={'LANG': 'C'})
- if 'GNU tar' in tar_version.stdout.read().decode():
+ [tar_executable, '--version'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env={'LANG': 'C'})
+ sout, _ = tar_version.communicate()
+ if 'GNU tar' in sout.decode():
config.available_features.add('gnutar')
- tar_version.wait()
OpenPOWER on IntegriCloud