Index: build/config/ios/BUILD.gn |
diff --git a/build/config/ios/BUILD.gn b/build/config/ios/BUILD.gn |
index 71f87de3ff914a0112b14dcf86933f1842b5fcf1..f8091d155b05006e774caf5773ed82c091c401c0 100644 |
--- a/build/config/ios/BUILD.gn |
+++ b/build/config/ios/BUILD.gn |
@@ -112,6 +112,10 @@ config("runtime_library") { |
cflags_cc = common_cc_flags |
cflags_objcc = common_cc_flags |
} |
+ |
+ if (ios_enable_coverage) { |
+ configs = [ ":enable_coverage" ] |
+ } |
} |
config("ios_executable_flags") { |
@@ -136,6 +140,16 @@ config("xctest_config") { |
] |
} |
+# This enables support for LLVM code coverage. See |
+# http://llvm.org/docs/CoverageMappingFormat.html. |
+config("enable_coverage") { |
+ cflags = [ |
+ "-fprofile-instr-generate", |
+ "-fcoverage-mapping", |
+ ] |
+ ldflags = [ "-fprofile-instr-generate" ] |
+} |
+ |
group("xctest") { |
public_configs = [ ":xctest_config" ] |
} |