# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.
"""
Verifies that setting SDKROOT works. """
from __future__ import print_function
import TestGyp
import os import subprocess import sys
if sys.platform == 'darwin':
print("This test is currently disabled: https://crbug.com/483696.")
sys.exit(0)
test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
def GetSDKPath(sdk): """Return SDKROOT if the SDK version |sdk| is installed or empty string."""
DEVNULL = open(os.devnull, 'wb') try:
proc = subprocess.Popen(
['xcodebuild', '-version', '-sdk', 'macosx' + sdk, 'Path'],
stdout=subprocess.PIPE, stderr=DEVNULL) return proc.communicate()[0].rstrip('\n') finally:
DEVNULL.close()
def SelectSDK(): """Select the oldest SDK installed (greater than 10.6).""" for sdk in ['10.6', '10.7', '10.8', '10.9']:
path = GetSDKPath(sdk) if path: returnTrue, sdk, path returnFalse, '', ''
# Make sure this works on the bots, which only have the 10.6 sdk, and on # dev machines which usually don't have the 10.6 sdk.
sdk_found, sdk, sdk_path = SelectSDK() ifnot sdk_found:
test.fail_test()
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.