Filter on Category for NUnit MSBuild tasks?

我是研究僧i 提交于 2019-12-23 17:22:05

问题


I'm setting up a MSBuild project to run some NUnit test, using the MSBuild Community Tasks Project.

With these settings I'll be able to run the NUnit tests:

<Target Name="Test" DependsOnTargets="Build">
    <CreateItem Include="$(ProjectTestDir)\$(ClassLibraryOutputDirectory)\*.Tests.dll">
        <Output TaskParameter="Include" ItemName="TestAssembly" />
    </CreateItem>
    <NUnit Assemblies="@(TestAssembly)" />
</Target>

... but how can i run only certain tests - say the ones with a specific Category? We've added different categories to our tests - some to run all the time, some to only run at a nightly build etc.

I don't see any settings allowing me to filter on this, or did I miss something? Surely some of you have had this same problem and solved it somehow? It doesn't have to be using this msbuild community tasks project.


回答1:


Looking in the CHM, there's an IncludeCategory property... sounds like what you're looking for? (The CHM file is installed in C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks)



来源:https://stackoverflow.com/questions/1026117/filter-on-category-for-nunit-msbuild-tasks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!