2016-04-29 32 views
7

Aşağıdaki kurulum var: Aşağıdaki satırı çalıştığındavstest.console.exe çalışır, ancak iyi bir dosya adıyla, CodeCoverage.exe herhangi sonuçlar vermez değil

set __vsTestConsoleExe=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe 
set __codeCoverageExe=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe 

set __testFile=My.UnitTests.dll 

REM Below I get a ".coverage" file with the correct coverage. But the file name is kinda-random 
"%__vsTestConsoleExe%" "%__testFile%" /InIsolation /EnableCodeCoverage 

PAUSE 

REM Below I get a big ole nothing 
"%__codeCoverageExe%" collect /output:DynamicCodeCoverage.coverage "%__vsTestConsoleExe%" "%__testFile%" /InIsolation /EnableCodeCoverage 
"%__codeCoverageExe%" analyze /output:DynamicCodeCoverage.coveragexml DynamicCodeCoverage.coverage 

:

"%__vsTestConsoleExe%" "%__testFile%" /InIsolation /EnableCodeCoverage 

Ben iyi .coverage dosyasını almak, ama onun bir oluşturulan dosya adı gibi:

MyUSERNAME_MYMACHINE 2016-03-24 16_03_20.coverage 

(ilk kod bloğunda) PAUSE deyiminden sonra hatlar kapsama toplanmalı gibi görünüyorlar (ve not, ben aynı "% __ vsTestConsoleExe%" 'comamand veririm ....... ama ondan büyük bir şey yok.

Neyi yanlış yapıyorum?

cevap

0

Artık vstest.console.exe dosyasını çalıştıramadım.

"Öngörülebilir" bir dosya adı alıp MsTest.exe'yi kullanarak .coverage dosyasında bilgi aldım.

set __msTestExe=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe 
set __codeCoverageExe=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe 



REM the below calls will create the binary *.coverage files 
"%__codeCoverageExe%" collect /output:"D:\BuildStuff\TestResults\AAA_DynamicCodeCoverage.coverage" "%__msTestExe%" /testcontainer:"D:\BuildStuff\BuildResults\My.UnitTests.One.dll" /resultsfile:"D:\BuildStuff\TestResults\My.UnitTests.One.trx" 
"%__codeCoverageExe%" collect /output:"D:\BuildStuff\TestResults\BBB_DynamicCodeCoverage.coverage" "%__msTestExe%" /testcontainer:"D:\BuildStuff\BuildResults\My.UnitTests.Two.dll" /resultsfile:"D:\BuildStuff\TestResults\My.UnitTests.Two.trx" 
"%__codeCoverageExe%" collect /output:"D:\BuildStuff\TestResults\CCC_DynamicCodeCoverage.coverage" "%__msTestExe%" /testcontainer:"D:\BuildStuff\BuildResults\My.UnitTests.Three.dll" /resultsfile:"D:\BuildStuff\TestResults\My.UnitTests.Three.trx" 

Ayrıca

REM the below calls will create the binary *.coverage file 
"%__codeCoverageExe%" collect /output:"D:\BuildStuff\TestResults\ZZZ_DynamicCodeCoverage.coverage" "%__msTestExe%" /testcontainer:"D:\BuildStuff\BuildResults\My.UnitTests.One.dll" /testcontainer:"D:\BuildStuff\BuildResults\My.UnitTests.Two.dll" /testcontainer:"D:\BuildStuff\BuildResults\My.UnitTests.Three.dll" /resultsfile:"D:\BuildStuff\TestResults\My.UnitTests.AllOfThem.trx" 

ZZZ_DynamicCodeCoverage.coverage "tahmin edilebileceği" adlı, ve .coverage dosyasında gerçek değerlere sahip bir çağrıda 3 UnitTests.dlls birleştirebilirsiniz.

CodeCoverage.exe dosyası tarafından oluşturulan .coverage dosyalarının argüman listesinde .... vstest.console.exe ile neden oluşturulduğu konusunda hiçbir fikriniz yok. :( Yine, eşittir çalışmıyor. '........... İçindekini açıyor, ancak onu açıyor, içinde hiçbir bilgi yok. "