aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/RunIPhoneUnitTest.sh
diff options
context:
space:
mode:
Diffstat (limited to 'UnitTesting/RunIPhoneUnitTest.sh')
-rwxr-xr-xUnitTesting/RunIPhoneUnitTest.sh16
1 files changed, 15 insertions, 1 deletions
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