aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-03-11 20:19:06 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-03-11 20:19:06 +0000
commit398b1c8b28e2d542d632c6502aa0a498540edafc (patch)
treeb73794a6b3b0c41960bb540e5366eba3c082a8de /UnitTesting
parent483e8d866b40a298fcc28f7a8b670ff74f11c5ab (diff)
[Author: thomasvl]
Update the Run*UnitTests.sh script to support purging current target/config *.gcda files to avoid coverage merge warnings. Turn this on for the GTM unittests. R=dmaclach DELTA=38 (34 added, 0 deleted, 4 changed)
Diffstat (limited to 'UnitTesting')
-rwxr-xr-xUnitTesting/RunIPhoneUnitTest.sh15
-rwxr-xr-xUnitTesting/RunMacOSUnitTests.sh15
2 files changed, 30 insertions, 0 deletions
diff --git a/UnitTesting/RunIPhoneUnitTest.sh b/UnitTesting/RunIPhoneUnitTest.sh
index bf25714..ccf1456 100755
--- a/UnitTesting/RunIPhoneUnitTest.sh
+++ b/UnitTesting/RunIPhoneUnitTest.sh
@@ -38,6 +38,11 @@
# 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.
+#
ScriptDir=$(dirname $(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,"))
ScriptName=$(basename "$0")
@@ -54,6 +59,16 @@ if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then
# time.
/usr/bin/killall "iPhone Simulator"
+ if [ $GTM_REMOVE_GCOV_DATA ]; then
+ if [ "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" != "-" ]; then
+ if [ -d "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" ]; then
+ GTMXcodeNote ${LINENO} "Removing any .gcda files"
+ (cd "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" && \
+ find . -type f -name "*.gcda" -print0 | xargs -0 rm -f )
+ fi
+ fi
+ fi
+
export DYLD_ROOT_PATH="$SDKROOT"
export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"
export IPHONE_SIMULATOR_ROOT="$SDKROOT"
diff --git a/UnitTesting/RunMacOSUnitTests.sh b/UnitTesting/RunMacOSUnitTests.sh
index 23897f0..7b5e0a0 100755
--- a/UnitTesting/RunMacOSUnitTests.sh
+++ b/UnitTesting/RunMacOSUnitTests.sh
@@ -43,6 +43,11 @@
# 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.
+#
ScriptDir=$(dirname $(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,"))
ScriptName=$(basename "$0")
@@ -189,6 +194,16 @@ if [ ! $GTM_DISABLE_ZOMBIES ]; then
export NSZombieEnabled=YES
fi
+if [ $GTM_REMOVE_GCOV_DATA ]; then
+ if [ "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" != "-" ]; then
+ if [ -d "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" ]; then
+ GTMXcodeNote ${LINENO} "Removing any .gcda files"
+ (cd "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}" && \
+ find . -type f -name "*.gcda" -print0 | xargs -0 rm -f )
+ fi
+ fi
+fi
+
# If leaks testing is enabled, we have to go through our convoluted path
# to handle architectures that don't allow us to do leak testing.
if [ GTM_ENABLE_LEAKS ]; then