diff options
-rw-r--r-- | GTM.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | GTMiPhone.xcodeproj/project.pbxproj | 2 | ||||
-rw-r--r-- | ReleaseNotes.txt | 4 | ||||
-rwxr-xr-x | UnitTesting/RunIPhoneUnitTest.sh | 15 | ||||
-rwxr-xr-x | UnitTesting/RunMacOSUnitTests.sh | 15 |
5 files changed, 38 insertions, 4 deletions
diff --git a/GTM.xcodeproj/project.pbxproj b/GTM.xcodeproj/project.pbxproj index 8812f4b..90641a0 100644 --- a/GTM.xcodeproj/project.pbxproj +++ b/GTM.xcodeproj/project.pbxproj @@ -1316,7 +1316,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SRCROOT}/UnitTesting/RunMacOSUnitTests.sh\""; + shellScript = "# Nuke coverage data earch run\nexport GTM_REMOVE_GCOV_DATA=1\n# Run the unit tests in this test bundle.\n\"${SRCROOT}/UnitTesting/RunMacOSUnitTests.sh\""; }; F42E081D0D19987200D5DDE0 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -1329,7 +1329,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SRCROOT}/UnitTesting/RunMacOSUnitTests.sh\""; + shellScript = "# Nuke coverage data earch run\nexport GTM_REMOVE_GCOV_DATA=1\n# Run the unit tests in this test bundle.\n\"${SRCROOT}/UnitTesting/RunMacOSUnitTests.sh\""; }; F48FE2620D198C1E009257D2 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -1342,7 +1342,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SRCROOT}/UnitTesting/RunMacOSUnitTests.sh\"\n"; + shellScript = "# Nuke coverage data earch run\nexport GTM_REMOVE_GCOV_DATA=1\n# Run the unit tests in this test bundle.\n\"${SRCROOT}/UnitTesting/RunMacOSUnitTests.sh\"\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/GTMiPhone.xcodeproj/project.pbxproj b/GTMiPhone.xcodeproj/project.pbxproj index ffd1edc..46d0a0f 100644 --- a/GTMiPhone.xcodeproj/project.pbxproj +++ b/GTMiPhone.xcodeproj/project.pbxproj @@ -543,7 +543,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SRCROOT}/UnitTesting/RunIPhoneUnitTest.sh\"\n"; + shellScript = "# Nuke coverage data earch run\nexport GTM_REMOVE_GCOV_DATA=1\n# Run the unit tests in this test bundle.\n\"${SRCROOT}/UnitTesting/RunIPhoneUnitTest.sh\"\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 90c51ec..f07c847 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -257,6 +257,10 @@ Changes since 1.5.1 - Added GTMTheme for doing product wide theme modifications. +- The Run*UnitTest.sh script now support an env var to have them delete the + current target/configs *.gcda files to avoid coverage data warning when you + edit source. + Release 1.5.1 Changes since 1.5.0 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 |