aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/GTMCodeCoverageApp.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-11-26 16:00:18 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2013-11-26 16:00:18 +0000
commit6ef81aa11edbc435f9ab1eb2c1d6f47b1a93fa46 (patch)
tree705d20a91da688ae42254fd867673730e5689b6b /UnitTesting/GTMCodeCoverageApp.m
parentc17345207f7d1dedb291d63b90d182759f519679 (diff)
- Add gcov flushes that will happen within the test bundles to also capture
the coverage data there. Needed if you link some of your code directly into the test bundles or if you have code in headers (inlines, c++ templates, etc.) - Add a preprocessor gate to only bring in the coverage support when enabled, lets you add the source, and then use a Xcode Configuration to control when it is needed, otherwise you can end up linking coverage into your Release builds. DELTA=28 (28 added, 0 deleted, 0 changed)
Diffstat (limited to 'UnitTesting/GTMCodeCoverageApp.m')
-rw-r--r--UnitTesting/GTMCodeCoverageApp.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/UnitTesting/GTMCodeCoverageApp.m b/UnitTesting/GTMCodeCoverageApp.m
index 3bc7fae..415d0c0 100644
--- a/UnitTesting/GTMCodeCoverageApp.m
+++ b/UnitTesting/GTMCodeCoverageApp.m
@@ -25,6 +25,10 @@
#import "GTMCodeCoverageApp.h"
+// Add GTM_IS_COVERAGE_BUILD to your GCC_PREPROCESSOR_DEFINITIONS for the
+// Xcode Configuration that wants CodeCoverage support.
+#if GTM_IS_COVERAGE_BUILD
+
extern void __gcov_flush();
@implementation UIApplication(GTMCodeCoverage)
@@ -54,3 +58,5 @@ extern void __gcov_flush();
#endif // GTM_USING_XCTEST
@end
+
+#endif // GTM_IS_COVERAGE_BUILD