我目前正在尝试为我们的 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 "${Paths.Tools}\Gallio\Gallio.Echo.exe"" />
<arg line="--target-work-dir ${AssemblyToTestLocation}"/>
<arg line="--target-args /r:Local "${AssemblyToTest}"" />
<arg line="--include "[${Tests.TestedAssemblyName}]*"" />
<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 位安装。