Hey,
I'm using the method Ivo created here https://www.telerik.com/forums/vs2022---justmock-throwelevatedmockingexception-with-net-6
to build my runsettings file and generate code coverage in the command line with .net8.
Using
dotnet test my.sln --configuration Release --no-build --no-restore --settings test-coverage.runsettings
I would like to exclude dlls with Test in the name and also output xml or cobertura if possible but I can't seem to get it to work. Any ideas? Run settings below
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<ResultsDirectory>\CodeCoverageTestResults</ResultsDirectory>
<TestAdaptersPaths>C:\JustMock\Libraries\DataCollectors;C:\Users\GitHubRunner\.nuget\packages\microsoft.codecoverage\17.11.0\build\netstandard2.0</TestAdaptersPaths>
</RunConfiguration>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage Wrapper">
<Configuration>
<JustMockSettings>
<ProfilerPath32>C:\JustMock\Libraries\32\Telerik.CodeWeaver.Profiler.dll</ProfilerPath32>
<ProfilerPath64>C:\JustMock\Libraries\64\Telerik.CodeWeaver.Profiler.dll</ProfilerPath64>
</JustMockSettings>
<SinkDataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" isLinked="true">
<!-- Exclude DLLs with ".tests." in the name -->
<CodeCoverage>
<Exclude>
<ModuleFilePattern>*\.Tests\.*</ModuleFilePattern>
</Exclude>
</CodeCoverage>
</SinkDataCollector>
</Configuration>
</DataCollector>
<DataCollector friendlyName="JustMockDataCollector" />
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>