Skip to content

Commit 77e55c0

Browse files
committed
Enhance code coverage settings by excluding specific modules, attributes, sources, classes, and functions
1 parent f9aee2c commit 77e55c0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

build/targets/tests/test.runsettings

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,35 @@
1818
Discuss in https://github.com/microsoft/codecoverage.
1919
-->
2020
<ModulePath>.*Moq\.Analyzers\.dll$</ModulePath>
21+
<ModulePath>.*Moq\.CodeFixes\.dll$</ModulePath>
2122
</Include>
23+
<Exclude>
24+
<ModulePath>.*\.TestAdapter\.dll$</ModulePath> <!-- Excludes test adapters -->
25+
<ModulePath>.*xunit.*</ModulePath> <!-- Excludes xUnit framework -->
26+
</Exclude>
2227
</ModulePaths>
28+
<Attributes>
29+
<Exclude>
30+
<Attribute>System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute</Attribute>
31+
</Exclude>
32+
</Attributes>
33+
<Sources>
34+
<Exclude>
35+
<Source>.*/PerformanceSensitiveAttribute\.cs$</Source> <!-- Excludes the class source file -->
36+
</Exclude>
37+
</Sources>
38+
<Classes>
39+
<Exclude>
40+
<Class>Roslyn.Utilities.PerformanceSensitiveAttribute</Class> <!-- Excludes the class from coverage -->
41+
</Exclude>
42+
</Classes>
43+
<Functions>
44+
<Exclude>
45+
<Function>^get_.*</Function> <!-- Excludes property getters -->
46+
<Function>^set_.*</Function> <!-- Excludes property setters -->
47+
<Function>^.*Test.*</Function> <!-- Excludes test methods -->
48+
</Exclude>
49+
</Functions>
2350
</CodeCoverage>
2451
</Configuration>
2552
</DataCollector>

0 commit comments

Comments
 (0)