在类别上过滤NUnit MSBuild任务? [英] Filter on Category for NUnit MSBuild tasks?

查看:238
本文介绍了在类别上过滤NUnit MSBuild任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置一个MSBuild项目,以便使用 MSBuild社区任务项目运行某些NUnit测试。

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

使用这些设置,我可以运行NUnit测试:

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.

我没有看到任何设置我过滤这个,还是我错过了什么?当然,你有一些人有同样的问题,解决了不知何故?它不必使用这个msbuild社区任务项目。

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.

推荐答案

查看CHM,有一个IncludeCategory属性。 。听起来像你要找的? (CHM文件安装在C:\Program Files(x86)\MSBuild\MSBuildCommunityTasks)

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)

这篇关于在类别上过滤NUnit MSBuild任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆