X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/f410558f5d60087e4c310119a1751b437121c3b9..e456bf1059cf7e6b8b71545d1b2f2092b55a9684:/unit-tests/run-all-unit-tests diff --git a/unit-tests/run-all-unit-tests b/unit-tests/run-all-unit-tests index cdab927..058878e 100755 --- a/unit-tests/run-all-unit-tests +++ b/unit-tests/run-all-unit-tests @@ -12,11 +12,29 @@ cd `echo "$0" | sed 's/run-all-unit-tests/test-cases/'` all_archs="x86_64 i386" valid_archs="x86_64 i386" +ios_sdk_directory="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs" # only test arm code if iOS platform tools installed -if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs ] +min_available_ios_sdk_version() +{ + ls "${ios_sdk_directory}" | + grep --invert-match --ignore-case "internal" | # exclude internal SDKs + sort --version-sort | head -n 1 | # take SDK with min version + sed "s/^iPhoneOS\(.*\)\.sdk$/\1/" # return only the version string +} +version_ge() +{ + test "$(printf '%s\n' "$@" | sort --version-sort | head -n 1)" == "$2"; +} +if [ -d $ios_sdk_directory ] then - all_archs="${all_archs} armv7" - valid_archs="${valid_archs} armv7" + arm_arch="armv7" + # Newer SDKs don't support older architectures. + if version_ge "$(min_available_ios_sdk_version)" "11.0" + then + arm_arch="arm64" + fi + all_archs="${all_archs} ${arm_arch}" + valid_archs="${valid_archs} ${arm_arch}" fi