Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 1 addition & 40 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ def darwin_get_sdk_version(sdk_path):
"ProductBuildVersion"]).rstrip()
return (name, vers, build)


def darwin_sdk_build_version_split(version):
m = re.search("([0-9]+)([A-Z])([0-9]+)", version)
return (int(m.group(1)), m.group(2), int(m.group(3)))


def darwin_sdk_build_version_cmp(lhs, rhs):
# The `_cmp` function is provided to port the Python 2 global `cmp`
# function forward to Python 3. The function implementation is taken
# directly from the recommendation that announced its removal.
# See: https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
def _cmp(a, b):
return (a > b) - (a < b)
return _cmp(
darwin_sdk_build_version_split(lhs),
darwin_sdk_build_version_split(rhs))


# Run sw_vers on the target to be tested and return the results.
def darwin_get_sw_vers(commandPrefix=[]):
name = lit.util.executeCommand(
Expand All @@ -98,19 +80,7 @@ def darwin_get_ios_sim_vers():
def get_simulator_command(run_os, run_cpu, sdk_path):
(name, vers, build) = darwin_get_sdk_version(sdk_path)
if run_os == 'ios':
# There are two binaries for the iOS simulator: 'sim' and 'simctl'.
# 'sim' is only supported for iOS <= 8.1 and early versions of 8.2.
# 'simctl' is supported for iOS >= 8.2.
# 'simctl' used to have a bug where it failed to propagate the exit
# code of the child process. This was fixed only in the middle of 8.2
# development cycle.
if ((darwin_sdk_build_version_cmp(build, "12E999") <= 0) or
(darwin_sdk_build_version_cmp("12F1", build) <= 0 and
darwin_sdk_build_version_cmp(build, "12F12") <= 0) or
(darwin_sdk_build_version_cmp("12H1", build) <= 0 and
darwin_sdk_build_version_cmp(build, "12H11") <= 0)):
return "sim"
elif run_cpu == "i386":
if run_cpu == "i386":
if min(darwin_get_ios_sim_vers()) > 10.3:
print("ERROR: Install iOS 10.3 or older simulator for 32bit testing")
print("INFO: Xcode -> Preferences -> Components -> Simulators")
Expand All @@ -130,15 +100,6 @@ def get_lldb_python_path(lldb_build_root):
lldb_path = os.path.join(lldb_build_root, 'bin', 'lldb')
return subprocess.check_output([lldb_path, "-P"]).rstrip()

assert darwin_sdk_build_version_cmp("11A1", "12A1") < 0
assert darwin_sdk_build_version_cmp("12A1", "11A1") > 0

assert darwin_sdk_build_version_cmp("11A1", "11B1") < 0
assert darwin_sdk_build_version_cmp("11B1", "11A1") > 0

assert darwin_sdk_build_version_cmp("11A22", "11A100") < 0
assert darwin_sdk_build_version_cmp("11A100", "11A22") > 0

###

# Check that the object root is known.
Expand Down