Skip to content

Commit 970fcea

Browse files
committed
update readme to mention new settings algorithm
1 parent 7a181b0 commit 970fcea

File tree

1 file changed

+54
-10
lines changed

1 file changed

+54
-10
lines changed

README.md

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ or download from [releases](https://github.com/FortuneN/FineCodeCoverage/release
1010

1111
Only that the test adapters are nuget packages. For instance, the NUnit Test Adapter extension is not sufficient.
1212

13-
1413
---
1514

1615
## Introduction
@@ -21,10 +20,10 @@ tool for most developers. It is currently in Beta.
2120

2221
With the old coverage it was possible for FCC to provide an abstraction over each tool's exclusion / inclusion options. This abstraction does not work for MS code coverage.
2322
Thus you will find that there are separate configuration options for Ms coverage vs old coverage and options that are common to the two.
24-
Configuration is available with Visual Studio options and project msbuild properties. All visual studio settings can be overridden from test project settings and some settings
25-
can only be set in project files.
23+
Configuration is ( mostly ) determined from Visual Studio options, finecodecoverage-settings.xml files and project msbuild properties. All of these settings are optional.
24+
For options that have a project scope, these settings form a hierarchy where lower levels override or, for collections, override or merge with the level above. This is described in detail further on.
2625

27-
Regardless of the coverage tool employed the process begins with FCC reacting to the test explorer in visual studio. One of the 3 coverage tools provides the coverage results that are presented as a single unified report in the Fine Code Coverage Tool Window. The report shows line and branch coverage and risk hotspots with the facility to open your class files that will have coloured margins to indicate uncovered or partially covered code.
26+
Regardless of the coverage tool employed the process begins with FCC reacting to the test explorer in visual studio. One of the 3 coverage tools provides the coverage results that are presented as a single unified report in the Fine Code Coverage Tool Window. The report shows line and branch coverage and risk hotspots with the facility to open your class files, that will have coloured margins to indicate uncovered or partially covered code.
2827
This coverage is not dynamic and represents the coverage obtained from the last time you executed tests. When the coverage becomes outdated, you can click the 'FCC Clear UI' button in Tools or run coverage again.
2928

3029
Details of how FCC is progressing with code coverage can be found in the Coverage Log tab in the Fine Code Coverage Tool Window with more detailed logs in the FCC Output Window Pane. If you experience issues then providing the logs from the output window will help to understand the nature of the problem.
@@ -48,11 +47,11 @@ FCC does not require you to do this. If you do not provide a runsettings and Ru
4847
## Run settings generation from template
4948

5049
FCC includes the ms code coverage package and will create the necessary runsettings file for each test project being run from the test explorer window.
51-
The exclusions and inclusions will come from visual studio options or from the project file in a similar manner to the old coverage. As ms code coverage uses regex and has different methods of exclusion / inclusion to
52-
Coverlet and OpenCover there are ms specific Visual Studio options and project elements.
50+
The exclusions and inclusions will come from the combined settings, in a similar manner to the old coverage. As ms code coverage uses regex and has different methods of exclusion / inclusion to
51+
Coverlet and OpenCover there are ms specific Visual Studio options and associated elements.
5352

5453
As FCC provides a runsettings file for each test project ( if you have not provided a solution wide or project specific ) it has to write the RunSettingsFilePath element in the project file.
55-
Although FCC removes this element from the project file it will still show as git modified.
54+
Although FCC clears the value of this element from the project file it is still present.
5655

5756
FCC creates the runsettings from a template using string replacement. If so desired you can provide your own templates. FCC will look for fcc-ms-runsettings-template.xml in the project directory or the solution directory.
5857
Your template needs to be a valid xml document but does not need to supply all of the run settings elements. FCC will add the replaceable ResultsDirectory and TestAdaptersPaths ( and the container RunConfiguration element if necessary)
@@ -108,10 +107,42 @@ Run a(some) unit test(s) and ...
108107
#### See Risk Hotspots View
109108
![Risk Hotspots View](Art/Output-RiskHotspots.png)
110109

111-
#### Global (Shared) options
110+
## Project configuration
111+
112+
The hierarchy is as follows :
113+
114+
a) Visual Studio options
115+
112116
![Global Options](Art/Options-Global.png)
113117

114-
#### Local (Test Project) options (override globals in your csproj/vbproj : OPTIONAL)
118+
119+
b) finecodecoverage-settings.xml files
120+
121+
These are found by walking up the directory structure from the project directory.
122+
By applying the attribute topLevel='true' to the root element the walk stops.
123+
124+
Given finecodecoverage-settings.xml in project directory and finecodecoverage-settings.xml in the solution directory the
125+
hierachy is :
126+
127+
Visual Studio options
128+
129+
Solution level finecodecoverage-settings.xml
130+
131+
Project level finecodecoverage-settings.xml
132+
133+
```
134+
<FineCodeCoverage>
135+
<Enabled>
136+
True
137+
</Enabled>
138+
<!-- and more -->
139+
</FineCodeCoverage>
140+
```
141+
142+
c) msbuild project file
143+
144+
There are two ways of supplying these settings.
145+
Directly in the project file
115146
```
116147
<PropertyGroup Label="FineCodeCoverage">
117148
<Enabled>
@@ -140,7 +171,8 @@ Run a(some) unit test(s) and ...
140171
<!-- and more -->
141172
</PropertyGroup>
142173
```
143-
or **( necessary if storing project settings outside your project file and using msbuild Import )**
174+
175+
With the FineCodeCoverage element.
144176
```
145177
<PropertyGroup>
146178
<FineCodeCoverage>
@@ -151,6 +183,18 @@ or **( necessary if storing project settings outside your project file and using
151183
</FineCodeCoverage>
152184
</PropertyGroup>
153185
```
186+
This is **necessary** if storing project settings outside your project file and using msbuild Import.
187+
188+
It is also **necessary if** you want to have the setting element merge with that from the level above as msbuild does not
189+
support custom attributes.
190+
191+
### Controlling merge
192+
193+
The default is to overwrite each collection property. This can be changed for all settings by setting defaultMerge='true' on the root element.
194+
195+
If you do supply the merge attribute on a setting element then it will be used.
196+
197+
### Project only
154198

155199
#### Exclude Referenced Project in referenced project ( csproj/vbproj : OPTIONAL )
156200
```

0 commit comments

Comments
 (0)