[PATCH] D54522: Fix running tests on macOS with python3
Alexander Richardson via Phabricator
reviews at reviews.llvm.org
Wed Nov 14 10:01:29 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346878: [libcxx] [test] Fix running tests on macOS with python3 (authored by arichardson, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
https://reviews.llvm.org/D54522
Files:
libcxx/trunk/utils/libcxx/test/target_info.py
Index: libcxx/trunk/utils/libcxx/test/target_info.py
===================================================================
--- libcxx/trunk/utils/libcxx/test/target_info.py
+++ libcxx/trunk/utils/libcxx/test/target_info.py
@@ -15,6 +15,8 @@
import subprocess
import sys
+from libcxx.util import executeCommand
+
class DefaultTargetInfo(object):
def __init__(self, full_config):
self.full_config = full_config
@@ -127,14 +129,13 @@
cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
else:
cmd = ['xcrun', '--show-sdk-path']
- try:
- out = subprocess.check_output(cmd).strip()
- res = 0
- except OSError:
- res = -1
- if res == 0 and out:
- sdk_path = out
+ out, err, exit_code = executeCommand(cmd)
+ if exit_code != 0:
+ self.full_config.lit_config.warning("Could not determine macOS SDK path! stderr was " + err)
+ if exit_code == 0 and out:
+ sdk_path = out.strip()
self.full_config.lit_config.note('using SDKROOT: %r' % sdk_path)
+ assert isinstance(sdk_path, str)
flags += ["-isysroot", sdk_path]
def add_cxx_link_flags(self, flags):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54522.174058.patch
Type: text/x-patch
Size: 1241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20181114/632991f1/attachment.bin>
More information about the libcxx-commits
mailing list