PartCover 生成空输出文件

发布于 2024-11-15 08:22:37 字数 1409 浏览 2 评论 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 位安装)。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

放飞的风筝 2024-11-22 08:22:37

我相信我们在 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}*]* ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文