From 22047b856c5b4df0b32e3e2044e533085003ae4c Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Mon, 23 Sep 2013 17:17:41 +0200 Subject: [PATCH] Fixes for getting test coverage working again Xcode 5 does not create .gcda files due to a bug. The workaround used in here has been suggested in the devforums: https://devforums.apple.com/thread/199643?start=0&tstart=0 --- Support/HockeySDK.xcodeproj/project.pbxproj | 5 +++++ Support/HockeySDKTests/BITAuthenticatorTests.m | 5 +++++ Support/HockeySDKTests/BITHockeyAppClientTests.m | 5 +++++ Support/HockeySDKTests/BITKeychainUtilsTests.m | 6 +++++- Support/HockeySDKTests/BITStoreUpdateManagerTests.m | 5 +++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Support/HockeySDK.xcodeproj/project.pbxproj b/Support/HockeySDK.xcodeproj/project.pbxproj index 783ae8f641..a27e0f11e4 100644 --- a/Support/HockeySDK.xcodeproj/project.pbxproj +++ b/Support/HockeySDK.xcodeproj/project.pbxproj @@ -1120,15 +1120,18 @@ 1E68F4A816F7843F00053706 /* CodeCoverage */ = { isa = XCBuildConfiguration; buildSettings = { + "ARCHS[sdk=iphonesimulator*]" = "$(BIT_SIM_ARCHS)"; DSTROOT = /tmp/HockeySDK.dst; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/../Vendor\"", ); GCC_THUMB_SUPPORT = NO; + GENERATE_PROFILING_CODE = YES; PRODUCT_NAME = HockeySDK; PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)"; SKIP_INSTALL = YES; + "VALID_ARCHS[sdk=iphonesimulator*]" = "$(BIT_SIM_ARCHS)"; }; name = CodeCoverage; }; @@ -1162,6 +1165,7 @@ 1E68F4AC16F7843F00053706 /* CodeCoverage */ = { isa = XCBuildConfiguration; buildSettings = { + "ARCHS[sdk=iphonesimulator*]" = "$(BIT_SIM_ARCHS)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_CONSTANT_CONVERSION = YES; @@ -1182,6 +1186,7 @@ "$(inherited)", ); GCC_WARN_UNINITIALIZED_AUTOS = YES; + GENERATE_PROFILING_CODE = YES; INFOPLIST_FILE = "HockeySDKTests/HockeySDKTests-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.1; LIBRARY_SEARCH_PATHS = ( diff --git a/Support/HockeySDKTests/BITAuthenticatorTests.m b/Support/HockeySDKTests/BITAuthenticatorTests.m index 26b5760b84..867a0a9a2f 100644 --- a/Support/HockeySDKTests/BITAuthenticatorTests.m +++ b/Support/HockeySDKTests/BITAuthenticatorTests.m @@ -60,6 +60,11 @@ static void *kInstallationIdentification = &kInstallationIdentification; } - (void)tearDown { +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wimplicit" + __gcov_flush(); +# pragma clang diagnostic pop + [_sut cleanupInternalStorage]; _sut = nil; diff --git a/Support/HockeySDKTests/BITHockeyAppClientTests.m b/Support/HockeySDKTests/BITHockeyAppClientTests.m index 14bf8792e5..e9502e095b 100644 --- a/Support/HockeySDKTests/BITHockeyAppClientTests.m +++ b/Support/HockeySDKTests/BITHockeyAppClientTests.m @@ -33,6 +33,11 @@ } - (void)tearDown { +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wimplicit" + __gcov_flush(); +# pragma clang diagnostic pop + [_sut cancelOperationsWithPath:nil method:nil]; _sut = nil; diff --git a/Support/HockeySDKTests/BITKeychainUtilsTests.m b/Support/HockeySDKTests/BITKeychainUtilsTests.m index 514a6e448c..9c317be6ac 100644 --- a/Support/HockeySDKTests/BITKeychainUtilsTests.m +++ b/Support/HockeySDKTests/BITKeychainUtilsTests.m @@ -32,7 +32,11 @@ - (void)tearDown { // Tear-down code here. - +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wimplicit" + __gcov_flush(); +# pragma clang diagnostic pop + [super tearDown]; } diff --git a/Support/HockeySDKTests/BITStoreUpdateManagerTests.m b/Support/HockeySDKTests/BITStoreUpdateManagerTests.m index 473797532b..aa4e897536 100644 --- a/Support/HockeySDKTests/BITStoreUpdateManagerTests.m +++ b/Support/HockeySDKTests/BITStoreUpdateManagerTests.m @@ -43,6 +43,11 @@ - (void)tearDown { // Tear-down code here. +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wimplicit" + __gcov_flush(); +# pragma clang diagnostic pop + _storeUpdateManager = nil; [super tearDown];