aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/RunIPhoneUnitTest.sh
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-04-12 17:30:13 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-04-12 17:30:13 +0000
commitd29ad6ab994d10593a44c5a59bc35c2a739ba257 (patch)
tree2283605aa85a12d97844652712a5195080a9fc2e /UnitTesting/RunIPhoneUnitTest.sh
parent70b8dabdc5c535c9d7640ae42d232ed98c022e80 (diff)
[Author: agrieve]
-Add logic to RunIPhoneUnitTest.sh to allow skipping tests based on the TEST_AFTER_BUILD variable -Add a script to GTM for running the active target using xcodebuild, and enabling TEST_AFTER_BUILD. R=thomasvl APPROVED=thomasvl DELTA=52 (51 added, 0 deleted, 1 changed)
Diffstat (limited to 'UnitTesting/RunIPhoneUnitTest.sh')
-rwxr-xr-xUnitTesting/RunIPhoneUnitTest.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/UnitTesting/RunIPhoneUnitTest.sh b/UnitTesting/RunIPhoneUnitTest.sh
index ce3f2dc..1cb07d4 100755
--- a/UnitTesting/RunIPhoneUnitTest.sh
+++ b/UnitTesting/RunIPhoneUnitTest.sh
@@ -66,6 +66,12 @@ GTM_DISABLE_USERDIR_SETUP=${GTM_DISABLE_USERDIR_SETUP:=0}
# to turn it on.
GTM_DISABLE_IPHONE_LAUNCH_DAEMONS=${GTM_DISABLE_IPHONE_LAUNCH_DAEMONS:=1}
+# GTM_TEST_AFTER_BUILD
+# When set to 1, tests are run only when TEST_AFTER_BUILD is set to "YES".
+# This can be used to have tests run as an after build step when running
+# from the command line, but not when running from within XCode.
+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}"
@@ -94,7 +100,9 @@ GTMCreateLaunchDaemonPlist() {
-c "Add :MachServices:com.apple.securityd bool YES" "$plist_file" > /dev/null
}
-if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then
+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
# 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