From 61732104b91222d1f0632a4dc261afd0b66a45e5 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 6 Aug 2012 21:30:11 +0000 Subject: [Author: thomasvl] But in a version check and error out if the Xcode version appears to be too new for support the way unittests are run. R=dmaclach DELTA=15 (14 added, 0 deleted, 1 changed) --- UnitTesting/RunIPhoneUnitTest.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'UnitTesting') diff --git a/UnitTesting/RunIPhoneUnitTest.sh b/UnitTesting/RunIPhoneUnitTest.sh index 1cb07d4..743d1ec 100755 --- a/UnitTesting/RunIPhoneUnitTest.sh +++ b/UnitTesting/RunIPhoneUnitTest.sh @@ -75,9 +75,14 @@ GTM_USE_TEST_AFTER_BUILD=${GTM_USE_TEST_AFTER_BUILD:=0} ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")") ScriptName=$(basename "$0") ThisScript="${ScriptDir}/${ScriptName}" +XCODE_VERSION_MINOR=${XCODE_VERSION_MINOR:=0000} GTMXcodeNote() { - echo ${ThisScript}:${1}: note: GTM ${2} + echo "${ThisScript}:${1}: note: GTM ${2}" +} + +GTMXcodeError() { + echo "${ThisScript}:${1}: error: GTM ${2}" } # Creates a file containing the plist for the securityd daemon and prints the @@ -103,6 +108,15 @@ GTMCreateLaunchDaemonPlist() { if [[ "$GTM_USE_TEST_AFTER_BUILD" == 1 && "$TEST_AFTER_BUILD" == "NO" ]]; then GTMXcodeNote ${LINENO} "Skipping running of unittests since TEST_AFTER_BUILD=NO." elif [ "$PLATFORM_NAME" == "iphonesimulator" ]; then + # Xcode 4.5 changed how simulator app can be run. The way this script has + # been working results in them now just logging a message and calling exit(0) + # from Apple code. Report the error that the tests aren't going to work. + if [[ "${XCODE_VERSION_MINOR}" -ge "0450" ]]; then + GTMXcodeError ${LINENO} \ + "Unit testing process not supported on Xcode >= 4.5 (${XCODE_VERSION_MINOR}). Use RuniOSUnitTestsUnderSimulator.sh." + exit 1 + fi + # We kill the iPhone simulator because otherwise we run into issues where # the unittests fail becuase the simulator is currently running, and # at this time the iPhone SDK won't allow two simulators running at the same -- cgit v1.2.3