Nam*_* VU 51 command-line unit-testing visual-studio-2010 tfs2010
我用Google搜索并找到了以下有用的参考资料.目前我希望在以下情况下从命令行运行所有内容(为了便于执行和快速):
我不知道如何才能为上述需求编写正确的命令.
参考文献:
过了一会儿,我发现了以下有用的提示.
%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe
我的情况下的MSTest.exe运行Visual Studio单元测试./testcontainer:Path\To\Your\TestProjectAssembly.dll
以指示您的测试编码.如果需要,您可以指定多个'/ testcontainer'选项./test:TestFilter
过滤来运行测试.请注意,此过滤器适用于完整的测试方法名称(即FullNamespace.Classname.MethodName)Nam*_* VU 15
目前我可以根据自己的需求得到一些答案:
特定测试(即通过标记的方法编写的测试[TestMethod()]
)
使用MSTest.exe
/container:
TheAssemblyContainingYourSpecificTest /test:
TheSpecificTestName
类中的所有测试
使用MSTest.exe
/container:
TheAssemblyContainingYourClass /test:
TheClassNameWithFullNamespace
注意,/test:
过滤时使用类的全名的过滤器.
其他人仍然未知.如果你知道如何,请讨论.
有问必答
5 除了标记为类别的所有测试 [TestCategory("some-category")]
用
mstest.exe /testcontainer:yourTests.dll /category:"!some-category"
Run Code Online (Sandbox Code Playgroud)
如果您需要排除多个类别,请使用
mstest.exe /testcontainer:yourTests.dll /category:"!group1&!group2"
Run Code Online (Sandbox Code Playgroud)
参考: /类别过滤器
您可能对Gallio捆绑包感兴趣。它提供了一个免费的通用自动化平台,可以使用各种测试运行程序(GUI、命令行、PoSh、第三方工具插件等)运行测试(MSTest、MbUnit、NUnit、xUnit 等)
特别是,您可能想要使用Gallio.Echo,这是一个很好的命令行测试运行器:
Gallio 测试运行程序还具有过滤功能,仅运行单元测试的子集(例如,按类别、按装置等)
归档时间: |
|
查看次数: |
41217 次 |
最近记录: |