S. Koshelnyk
S. Koshelnyk

Reputation: 506

CoverletOutputFormat vstest.console

I need to set up Coveralls. Before this I am trying to set up /p:CoverletOutputFormat=lcov with vstest.console. So I am successfully using dotnet test --results-directory "./testresults" -l trx -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=lcov to set CoverletOutputFormat with dotnet test command. This case is working.

But currently I need to use it for dotnet vstest

My full command is: vstest.console MyFolder\MyDll.dll /ResultsDirectory:"./testresults" /Logger:trx /EnableCodeCoverage /p:CoverletOutputFormat=lcov The output is: The argument /p:CoverletOutputFormat=lcov is invalid

Upvotes: 1

Views: 1768

Answers (1)

riQQ
riQQ

Reputation: 12813

Option 1

vstest.console MyFolder\MyDll.dll /ResultsDirectory:"./testresults" /Logger:trx /EnableCodeCoverage --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=lcov


Option 2

Use the following command and runsettings file:

vstest.console MyFolder\MyDll.dll /ResultsDirectory:"./testresults" /Logger:trx /EnableCodeCoverage /Settings:CodeCoverage.runsettings

CodeCoverage.runsettings

<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
  <DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector friendlyName="XPlat Code Coverage">
        <Configuration>
          <Format>lcov</Format>
        </Configuration>
      </DataCollector>
    </DataCollectors>
  </DataCollectionRunSettings>
</RunSettings>

Upvotes: 1

Related Questions