[testsuite] Fix TestAppleSimulator so that it works with Python 3.

llvm-svn: 352710
This commit is contained in:
Davide Italiano 2019-01-31 01:17:47 +00:00
parent 699bc17953
commit 46138cdb0d
2 changed files with 3 additions and 3 deletions

View File

@ -363,7 +363,7 @@ def apple_simulator_test(platform):
return "simulator tests are run only on darwin hosts"
try:
DEVNULL = open(os.devnull, 'w')
output = subprocess.check_output(["xcodebuild", "-showsdks"], stderr=DEVNULL)
output = subprocess.check_output(["xcodebuild", "-showsdks"], stderr=DEVNULL).decode("utf-8")
if re.search('%ssimulator' % platform, output):
return None
else:

View File

@ -40,7 +40,7 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase):
self.assertIsNotNone(deviceUDID)
exe_name = 'test_simulator_platform_{}'.format(platform)
sdkroot = subprocess.check_output(['xcrun', '--show-sdk-path', '--sdk',
sdk])
sdk]).decode("utf-8")
self.build(dictionary={ 'EXE': exe_name, 'SDKROOT': sdkroot.strip(),
'ARCH': arch })
exe_path = self.getBuildArtifact(exe_name)
@ -51,7 +51,7 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase):
# Get the PID from the process output
pid = None
while not pid:
stderr = sim_launcher.stderr.readline()
stderr = sim_launcher.stderr.readline().decode("utf-8")
if stderr == '':
continue
m = re.match(r"PID: (.*)", stderr)