2011-06-15 74 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