2011-06-15 59 views
0

我目前正試圖爲我們的TeamCity設置創建南特的任務,使我們的單元測試通過加利奧跑和PartCover覆蓋。這項任務看起來是這樣的:PartCover產生空的輸出文件

<!-- UnitTest Configuration --> 
    <!-- ====================== --> 
    <!-- This configuration runs the tests through Gallio with MbUnit together with 
     PartCover to get the results of the test together with the coverage results 
    --> 
    <target name="unitTest">  
     <echo message="Unittesting ${AssemblyToTest}"/> 
     <exec program="${Paths.Tools}\PartCover\Partcover.exe" failonerror="true"> 
      <arg line="--target &quot;${Paths.Tools}\Gallio\Gallio.Echo.exe&quot;" /> 
      <arg line="--target-work-dir ${AssemblyToTestLocation}"/> 
      <arg line="--target-args /r:Local &quot;${AssemblyToTest}&quot;" /> 
      <arg line="--include &quot;[${Tests.TestedAssemblyName}]*&quot;" /> 
      <arg line="--output ${Paths.Output}\Coverage.xml" /> 
     </exec> 
    </target> 

的測試運行,我們可以在TeamCity的看到這一點,並生成一個Coverage.xml文件,而空。它只有一條線。

輸出變量: -

  • $ {} Paths.Tools:C:\羅賓遜\幹線\
  • $ {} Tests.TestedAssemblyName:名稱的DLL
  • $ {的AssemblyToTestLocation }:路徑到DLL

我這麼想嗎?

編輯 的TeamCity的應用程序在Windows Server 2003 R2服務器上運行,而且所有演藝工作在構建代理在Windows XP系統中,所有32位的安裝正在運行。

+0

是在32位或64位Windows上運行您的TeamCity服務器? – GiddyUpHorsey 2011-06-16 05:51:45

+0

我們的TeamCity在Windows Server 2003 R2的服務器上運行,所以我認爲它是32位的,因爲它無處提及。這些測試beeing上構建代理您正在使用什麼版本的.NET這是目前所有的Windows XP 32位系統 – 2011-06-16 06:44:33

+0

跑? – GiddyUpHorsey 2011-06-16 23:40:58

回答

1

我相信我們覆蓋https://github.com/sawilde/partcover.net4/issues/46

這個問題和解決方案是沿

--include [$ {Tests.TestedAssemblyName} *] *行?

+0

我們做了:) 我們甚至在http://www.russellallen.info/post/Automating-Test-Coverage-with-PartCover-NUnit-and-Nant.aspx上進一步討論和解決問題 – 2011-06-21 06:59:57