Visual Studio使用哪些命令行参数来运行MsTest? [英] What command line arguments does Visual Studio use for running MsTest?
问题描述
我试图找出运行MsTest测试时Visual Studio使用的命令行参数,我想它的开头是:
I'm trying to figure out which is the command line arguments used by Visual Studio when you run the MsTest tests, I guess it starts with:
MSTest.exe /testmetadata:%SolutionName%.vsmdi /testlist:
但是我无法弄清楚如何填充testlist参数,因为测试列表名称和ID都会出现以下错误:
But I couldn't figure out how to fill the testlist parameter, because both the test list name and id get the following error:
The test list path 8c43105b-9dc1-4917-a39f-aa66a61bf5b6 cannot be found.
An error occurred while executing the /testlist switch.
推荐答案
我正在尝试找出由哪个命令行参数使用 在运行MsTest测试时使用Visual Studio
I'm trying to figure out which is the command line arguments used by Visual Studio when you run the MsTest tests
这取决于您如何从Visual Studio运行测试.请参见以下示例:
It depends on how do you run your tests from Visual Studio. See the following examples:
-
您正在从
Test View
窗口中选择一些测试并运行它们
You are selecting some tests from the
Test View
window and run them
MSTest.exe /testcontainer:TestProject.dll /test:TestMethod1 /test:TestMethod2 ...
您正在从Test View
窗口运行所有测试
Your are running all the tests from the Test View
window
MSTest.exe /testcontainer:TestProject.dll
您已经通过Test View
窗口按类别过滤了测试,并运行了该类别
You have filtered your tests by a category through Test View
window and run this category
MSTest.exe /testcontainer:TestProject.dll /category:CategoryName
您已打开*.vsmdi
文件并选择了一些TestLists
来运行
You have opened the *.vsmdi
file and selected some TestLists
to run
MSTest.exe /testmetadata:*.vsmdi /testlist:TestList1 /testlist:TestList2 ...
您正在运行负载测试或有序测试
You are running Load or Ordered tests
MSTest.exe /testcontainer:LoadTest1.loadtest /testcontainer:OrderedTest1.orderedtest
您可以结合以上示例(参数)来创建适合您情况的MSTest
命令.唯一的限制是不能同时使用/testmetada
和/testcontainer
参数.
You can combine the above examples (arguments) to create the MSTest
command that suits on your case. The only restriction you have is that you cannot use the /testmetada
and /testcontainer
arguments together.
对于TestList
参数,您只需要提供列表名称作为参数即可.如果找不到,则您的测试列表不存在,或者不属于您在/testmetadata
参数上定义的*.vsmdi
.
As for the TestList
argument you just need to give as parameter the name of the list. If it is not found then your test list does not exist or it does not belong to the *.vsmdi
you have defined on the /testmetadata
argument.
我确定您已经完成了,但是您可以检查以下链接: MSTest.exe命令行选项
I am sure that you have already done it, but you can check the following link: MSTest.exe Command-Line Options
这篇关于Visual Studio使用哪些命令行参数来运行MsTest?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!