PartCover 生成空输出文件
我目前正在尝试为我们的 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 位安装)。
I'm currently trying to create a Nant task for our TeamCity setup so that our UnitTests are ran through Gallio and covered by PartCover. The task looks like this:
<!-- 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>
The tests are running, we can see this in TeamCity, and a Coverage.xml file is generated, but empty. There's only a single line in it.
Output of the variables:-
- ${Paths.Tools} : C:\Robinson\Trunk\
- ${Tests.TestedAssemblyName} : Name of the DLL
- ${AssemblyToTestLocation} : Path to the DLL
Am I missing something?
EDIT
The TeamCity application is running on a Windows Server 2003 R2 Server, and all the build-agents performing the work are currently running on Windows XP Systems, all 32bit installations.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信我们在 https://github.com/sawilde/partcover.net4/ 中讨论了这个问题issues/46
解决方案的思路是
--include [${Tests.TestedAssemblyName}*]* ?
I believe we covered this issue in https://github.com/sawilde/partcover.net4/issues/46
and the solution was along the lines of
--include [${Tests.TestedAssemblyName}*]* ?