Skip to content

Commit cf9205e

Browse files
committed
Instructions on how to test dev versions of coverlet against CoreFx
1 parent 54108b6 commit cf9205e

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,39 @@ These steps must be followed before you attempt to open the solution in an IDE (
434434
435435
### Performance testing
436436
437-
There is a performance test for the hit counting instrumentation in the test project `coverlet.core.performancetest`. Build the project with the msbuild step above and then run:
437+
There is a simple performance test for the hit counting instrumentation in the test project `coverlet.core.performancetest`. Build the project with the msbuild step above and then run:
438438
439439
dotnet test /p:CollectCoverage=true test/coverlet.core.performancetest/
440440
441441
The duration of the test can be tweaked by changing the number of iterations in the `[InlineData]` in the `PerformanceTest` class.
442442
443+
For more realistic testing it is recommended to try out any changes to the hit counting code paths on large, realistic projects. If you don't have any handy https://github.com/dotnet/corefx is an excellent candidate. [This page](https://github.com/dotnet/corefx/blob/master/Documentation/building/code-coverage.md) describes how to run code coverage tests for both the full solution and for individual projects with coverlet from nuget. Suitable projects (listed in order of escalating test durations):
444+
445+
* System.Collections.Concurrent.Tests
446+
* System.Collections.Tests
447+
* System.Reflection.Metadata.Tests
448+
* System.Xml.Linq.Events.Tests
449+
* System.Runtime.Serialization.Formatters.Tests
450+
451+
Change to the directory of the library and run the msbuild code coverage command:
452+
453+
dotnet msbuild /t:BuildAndTest /p:Coverage=true
454+
455+
Look for a line like this:
456+
457+
----- start 18:13:36,59 =============== To repro directly: =====================================================
458+
459+
It is followed by a `pushd` command into the artefact directory, and a command to run coverlet. Run these to get to see the coverlet output and especially the test duration. E.g.:
460+
461+
C:\...\corefx\artifacts\tools\coverlet "System.Collections.Concurrent.Tests.dll" --target ...
462+
463+
To run with a development version of coverlet call `dotnet run` instead of the installed coverlet version, e.g.:
464+
465+
dotnet run -p C:\...\coverlet\src\coverlet.console\coverlet.console.csproj -c Release -- "System.Collections.Concurrent.Tests.dll" --target ...
466+
467+
468+
469+
443470
444471
## Code of Conduct
445472

0 commit comments

Comments
 (0)