You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-14Lines changed: 22 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,12 @@
3
3
These scripts provide a simple way to generate HTML reports of the code coverage of your Xcode project.
4
4
5
5
6
-
Xcode Project Setup
7
-
===================
8
-
9
-
Before you get started, there are a couple of steps you will need to take to prepare your project:
10
-
11
-
1. Depending on your version of Xcode, you may need to get Xcode's coverage instrumentation by going to Xcode > Preferences, into Downloads, and installing Command Line Tools. If you do not see this as an option in the Downloads section, the tools should already be installed.
12
-
2. In your Xcode project, enable these two build settings at the project level for your Debug configuration only:
13
-
* Instrument Program Flow
14
-
* Generate Test Coverage Files
15
-
16
-
17
6
Installation: Standard
18
7
======================
19
8
20
-
1. Fork this repository; you're probably going to want to make your own modifications.
9
+
Use the standard installation if you want to customize XcodeCoverage to exclude certain files and directories, such as third-party libraries. Otherwise, the CocoaPods installation described below may be more convenient.
10
+
11
+
1. Fork this repository.
21
12
2. Place the XcodeCoverage folder in the same folder as your Xcode project.
22
13
3. In your main target, add a Run Script build phase to execute `XcodeCoverage/exportenv.sh`
23
14
@@ -44,6 +35,23 @@ The steps to install via CocoaPods:
44
35
Again, make sure you add the script to your main target (your app or library), not your test target.
45
36
46
37
38
+
Xcode Project Setup
39
+
===================
40
+
41
+
XcodeCoverage comes with an xcconfig file with the build settings required to instrument your code for coverage analysis.
42
+
43
+
If you already use an xcconfig, include it in the configuration you want to instrument:
44
+
* Standard installation: `#include "XcodeCoverage/XcodeCoverage.xcconfig"`
If you don't already use an xcconfig, drag XcodeCoverage.xcconfig into your project. Where it prompts "Add to targets," deselect all targets. (Otherwise, it will be included in the bundle.) Then click on your project in Xcode's Navigator pane, and select the Info tab. For the configuration you want to instrument, select XcodeCoverage.
48
+
49
+
If you'd rather specify the build settings by hand, enable these two settings at the project level:
50
+
* Instrument Program Flow
51
+
* Generate Test Coverage Files
52
+
53
+
Make sure not to instrument your AppStore release.
54
+
47
55
Execution
48
56
=========
49
57
@@ -68,13 +76,13 @@ If you make changes to your production code, you should clear out all build arti
68
76
* Edit Xcode scheme -> Test -> Post-actions
69
77
* Set "Shell" to: `/bin/bash`
70
78
* Set "Provide build settings from" to your main target
71
-
* Set script to:`source ${SRCROOT}/XcodeCoverage/run_code_coverage_post.sh` for standard installation. For CocoaPod installation, use `source ${SRCROOT}/Pods/XcodeCoverage/run_code_coverage_post.sh`
79
+
* 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`
72
80
73
81
74
82
Modification
75
83
============
76
84
77
-
If you are using the standard installation, you may wish to modify `exclude_data()` in `getcov` to specify which files to exclude, for example, third-party libraries.
85
+
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.
0 commit comments