diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-05-12 22:00:26 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-05-12 22:00:26 +0000 |
commit | 44f91fa12da8b48d4ee46d017e17fe3b4729e53e (patch) | |
tree | b4fb26d9e29baa0efd254c1ed700f5683e4c89c8 /UnitTesting/RunIPhoneUnitTest.sh | |
parent | 4f86270e6b63c5f050adf90b04a54dd4fbe8897b (diff) |
[Author: dmaclach]
Tightened up shell script error checking.
R=thomasvl
DELTA=27 (9 added, 10 deleted, 8 changed)
Diffstat (limited to 'UnitTesting/RunIPhoneUnitTest.sh')
-rwxr-xr-x | UnitTesting/RunIPhoneUnitTest.sh | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/UnitTesting/RunIPhoneUnitTest.sh b/UnitTesting/RunIPhoneUnitTest.sh index 82fa4c2..60610cb 100755 --- a/UnitTesting/RunIPhoneUnitTest.sh +++ b/UnitTesting/RunIPhoneUnitTest.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # RunIPhoneUnitTest.sh # Copyright 2008 Google Inc. # @@ -16,33 +16,39 @@ # # Runs all unittests through the iPhone simulator. We don't handle running them # on the device. To run on the device just choose "run". -# Controlling environment variables: -# + +set -o errexit +set -o nounset +set -o verbose + +# Controlling environment variables: # GTM_DISABLE_ZOMBIES - # Set to a non-zero value to turn on zombie checks. You will probably # want to turn this off if you enable leaks. -# +GTM_DISABLE_ZOMBIES=${GTM_DISABLE_ZOMBIES:=1} + # GTM_ENABLE_LEAKS - # Set to a non-zero value to turn on the leaks check. You will probably want # to disable zombies, otherwise you will get a lot of false positives. -# + # GTM_DISABLE_TERMINATION # Set to a non-zero value so that the app doesn't terminate when it's finished # running tests. This is useful when using it with external tools such # as Instruments. -# + # GTM_LEAKS_SYMBOLS_TO_IGNORE # List of comma separated symbols that leaks should ignore. Mainly to control # leaks in frameworks you don't have control over. # Search this file for GTM_LEAKS_SYMBOLS_TO_IGNORE to see examples. # Please feel free to add other symbols as you find them but make sure to # reference Radars or other bug systems so we can track them. -# + # GTM_REMOVE_GCOV_DATA # Before starting the test, remove any *.gcda files for the current run so # you won't get errors when the source file has changed and the data can't # be merged. # +GTM_REMOVE_GCOV_DATA=${GTM_REMOVE_GCOV_DATA:=0} ScriptDir=$(dirname $(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")) ScriptName=$(basename "$0") @@ -57,9 +63,11 @@ if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then # 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 # time. + set +e /usr/bin/killall "iPhone Simulator" - - if [ $GTM_REMOVE_GCOV_DATA ]; then + set -e + + if [ $GTM_REMOVE_GCOV_DATA -ne 0 ]; then if [ "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" != "-" ]; then if [ -d "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" ]; then GTMXcodeNote ${LINENO} "Removing any .gcda files" @@ -89,8 +97,9 @@ if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then # Turned off due to the amount of false positives from NS classes. # export OBJC_DEBUG_FINALIZERS=YES export OBJC_DEBUG_NIL_SYNC=YES + export OBJC_PRINT_REPLACED_METHODS=YES - if [ ! $GTM_DISABLE_ZOMBIES ]; then + if [ $GTM_DISABLE_ZOMBIES -eq 0 ]; then GTMXcodeNote ${LINENO} "Enabling zombies" export CFZombieLevel=3 export NSZombieEnabled=YES |