spekt / xunit.testlogger

XUnit logger for vstest platform
MIT License
73 stars 15 forks source link

Generate files (coverage.cobertura.xml) with the same name as the test project #22

Closed lzocateli closed 3 years ago

lzocateli commented 3 years ago

dotnet core SKD 3.1.300

`

<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.core" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Xunit.Extensions.Ordering" Version="1.4.5" />
<PackageReference Include="XunitXml.TestLogger" Version="2.1.26" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
<PackageReference Include="coverlet.msbuild" Version="2.7.0" />
<PackageReference Include="Moq" Version="4.14.4" />

`

I am using the following command to run my tests, in a solution that has several projects:

dotnet test "../MySoluction.sln" --logger "trx"
--logger "xunit" <--------- Here is the issue --results-directory ./TestResults /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude="[xunit.]"

--logger:"xunit;LogFilePath=(MyProjectName).coverage.xml"

I would like the generated xml file to have the same name as the .csproj

codito commented 3 years ago

Supported with {assembly} token in options in 3.0.56 release. Documentation for this feature is at https://github.com/spekt/testlogger/wiki/Logger-Configuration