0

我目前正在尝试为我们的 TeamCity 设置创建一个 Nant 任务,以便我们的单元测试通过 Gallio 运行并被 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:\Robinson\Trunk\
  • ${Tests.TestedAssemblyName} :DLL 的名称
  • ${AssemblyToTestLocation} :DLL 的路径

我错过了什么吗?

编辑 TeamCity 应用程序在 Windows Server 2003 R2 服务器上运行,所有执行工作的构建代理当前都在 Windows XP 系统上运行,所有 32 位安装。

4

1 回答 1

1

我相信我们在https://github.com/sawilde/partcover.net4/issues/46中讨论了这个问题

解决方案是

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

于 2011-06-21T05:46:06.010 回答