gpt4 book ai didi

tfs - 如何从VS2010用msbuild运行nunit

转载 作者:行者123 更新时间:2023-12-03 13:32:00 24 4
gpt4 key购买 nike

请告诉我如何使用msbuild运行nunit。我正在使用TFS进行代码集成和VS2010。

最佳答案

由于您正在使用Team Foundation Server,因此您可能想将NUnit与TFSBuild而不是MSBuild集成。

您将需要MSBuild任务才能运行NUnit,如以下三个教程中所述:


Using NUnit and NCover with TFS Build
Integrate Nunit test into a Tfs build
MSBuild with NUnit


最简单的方法是使用MSBuild Community Tasks,在该位置您已经可以使用NUnit任务,并且只需要将目标添加到msbuild文件中,如下所示:

<Target Name="RunTests">  
<!-- Run Unit tests -->
<CreateItem Include="$(OutDir)*.Tests.dll">
<Output TaskParameter="Include" ItemName="TestAssembly" />
</CreateItem>
<NUnit ToolPath="..\Tools\NUnit" DisableShadowCopy="true" Assemblies="@(TestAssembly)" />
</Target>

关于tfs - 如何从VS2010用msbuild运行nunit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4605267/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com