3

I partially found a solution to mstest with arguments: https://devnet.jetbrains.com/thread/471980

Command Prompt (Works ok):

dotcover analyse /TargetExecutable="c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MsTest.exe" /TargetArguments="/testcontainer:c:\MyApps\Modules\UnitTests\bin\Debug\UnitTests.dll" /Output="C:\temp\AppCoverageReport.html" /ReportType="HTML"

However when using XML I get parse error:

<?xml version="1.0" encoding="utf-8"?>
<AnalyseParams>
  <TargetExecutable>c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MsTest.exe</TargetExecutable>
  <TargetArguments>/testcontainer:c:\MyApp\Modules\UnitTests\bin\Debug\UnitTests.dll</TargetArguments>
  <Output>C:\Temp\AppCoverageReport.html</Output>
  <ReportType>html</ReportType>
</AnalyseParams>

What am i doing wrong?

ShaneKm
  • 20,823
  • 43
  • 167
  • 296

1 Answers1

2

Turns out I was mistyping the name of the xml file (type)

dotcover analyse c:\Temp\coverangeconfig.xml => extra 'n'

instead of:

dotcover analyse c:\Temp\coverageconfig.xml

So, to use dotCover with MsText.exe the following work:

  1. From command prompt
  2. From XML file (coverageconfig.xml)

for both: see code above. Make sure MsTest attribute "/testcontainer" is under /TargetArguments tag

ShaneKm
  • 20,823
  • 43
  • 167
  • 296