From ca3d74790bcf2d42bc6a9c3dc653c7e8a485705c Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Tue, 26 Nov 2013 17:30:06 +0000 Subject: Enable code coverage for GTM test suite in iOS 7. Call gcov_flush at end of tests manually if GTMCodeCoverageApp is available to receive request. DELTA=5 (5 added, 0 deleted, 0 changed) --- UnitTesting/GTMIPhoneUnitTestDelegate.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UnitTesting/GTMIPhoneUnitTestDelegate.m b/UnitTesting/GTMIPhoneUnitTestDelegate.m index 60baa0e..0318073 100644 --- a/UnitTesting/GTMIPhoneUnitTestDelegate.m +++ b/UnitTesting/GTMIPhoneUnitTestDelegate.m @@ -18,6 +18,7 @@ #import "GTMIPhoneUnitTestDelegate.h" +#import "GTMCodeCoverageApp.h" #import "GTMDefines.h" #if !GTM_IPHONE_SDK #error GTMIPhoneUnitTestDelegate for iPhone only @@ -94,6 +95,10 @@ - (void)runTestsAndExit:(UIApplication *)application { [self runTests]; + if ([application respondsToSelector:@selector(gtm_gcov_flush)]) { + [application performSelector:@selector(gtm_gcov_flush)]; + } + if (!getenv("GTM_DISABLE_TERMINATION")) { // To help using xcodebuild, make the exit status 0/1 to signal the tests // success/failure. -- cgit v1.2.3