gpt4 book ai didi

visual-studio-2010 - 如何将单元测试作为构建的一部分运行(非持续集成)

转载 作者:行者123 更新时间:2023-12-01 04:08:22 25 4
gpt4 key购买 nike

我有 Nunit 单元测试,我需要将它作为我的 MS 构建的一部分运行。 .

最佳答案

对于 NUnit 测试,AFAIK 还无法仅运行受影响的测试。但这对于 Visual Studio 2010 Ultimate/Test Professional 中的 MSTest 是可能的:

Recommending Tests to Run That are Affected by Code Changes

You can use Visual Studio Ultimate or Visual Studio Test Professional 2010 to help you determine which tests might have to be run, based on coding changes that were made to the application you are testing. To be able to use this functionality, you have to use Team Foundation Build to build your application and use Microsoft Visual Studio 2010 for version control for your source code



无论如何你可以使用 MSBuild Community NUnit Task从一组程序集运行测试。您可以将其作为标准 AfterBuild 的依赖目标来执行。目标通过指定 DependsOnTargets属性。

<NUnit Assemblies="..."
IncludeCategory="..."
ExcludeCategory="..."
ToolPath="$(NUnitDllsPath)"
ProjectConfiguration="$(Configuration)"
OutputXmlFile="$(NUnitOutputPath)\UnitTests.xml"
ContinueOnError="true">

关于visual-studio-2010 - 如何将单元测试作为构建的一部分运行(非持续集成),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7849201/

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