Skip to content

Commit 6f92efd

Browse files
Update README to include instructions on use of new exclusion strategy
1 parent 7097807 commit 6f92efd

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,22 @@ If you make changes to your production code, you should clear out all build arti
8181
* Set script to `source XcodeCoverage/run_code_coverage_post.sh` for standard installation. For CocoaPods installation, use `source Pods/XcodeCoverage/run_code_coverage_post.sh`
8282

8383

84-
Modification
85-
============
84+
Excluding Files From Coverage
85+
=============================
8686

87-
If you are using the standard installation, you can modify `exclude_data()` in `getcov` to specify which files to exclude, such as third-party libraries.
87+
If there are files or folders which you want to have the coverage generator ignore (for instance, third-party libraries not installed via CocoaPods or machine-generated files), add an `.xcodecoverageignore` file to your `SRCROOT`.
88+
89+
Each line should be a different file or group of files which should be excluded for code coverage purposes. You can use `SRCROOT` relative paths as well as the `*` character to indicate everything below a certain directory should be excluded.
90+
91+
Example contents of an `.xcodecoverageignore` file:
92+
93+
```
94+
${SRCROOT}/TestedProject/Machine Files/*
95+
${SRCROOT}/TestedProject/Third-Party/SingleFile.m
96+
${SRCROOT}/TestedProject/Categories/UIImage+IgnoreMe.{h,m}
97+
```
98+
99+
Note: If you were using a version of XcodeCoverage prior to 1.3, you will need to move the list of files and folders you wish to ignore to the `.xcodecoverageignore` file. The current setup will prevent your customized list from being overwritten when there is an update to this project.
88100

89101

90102
Credits

0 commit comments

Comments
 (0)