我是一个完全的构建系统新手。我已经抽出了两个星期的时间来尝试这个,但是一直没有解决,现在我觉得需要新的思路。我的最终目标是在我的TeamCity构建项目中生成一个新的NCover覆盖率报告(至少是摘要报告)。
我尝试过各种方式,包括在线演示、NCover官方提供的Extras以及大量阅读,但我已经有些困惑了!我在我的MSBuild脚本中有以下任务:
<Target Name="TestCoverage">
<Message Text="Test Assemblies @(TestAssemblies)" />
<Gallio RunnerType="NCover"
IgnoreFailures="true"
Files="@(TestAssemblies)"
ReportDirectory="Reports"
ReportTypes="xml"
ReportNameFormat="gallio_cover"
RunnerProperties="NCoverCoverageFile='$(MSBuildProjectDirectory)\Reports\codecoverage.xml';
NCoverArguments='//w %(TestAssemblies.RootDir)%(TestAssemblies.Directory) CoverageExcludeAttribute //ea //r:Local'" >
<Output TaskParameter="ExitCode" PropertyName="ExitCode"/>
</Gallio>
</Target>
我在生成的gallio_cover.xml报告中看到的错误信息是:
<logEntry severity="info" message="Connected
Profiled process terminated. Profiler connection not established." />
<logEntry severity="error" message="Host process exited with code: 1" />
我从上一条消息中剪掉了很多内容。
我看到了很多不同的例子,说明了应该如何通过Gallio调用NCover,但我似乎无法找出问题所在。
是否有任何想法或建议将不胜感激。
谢谢,
詹姆斯。