简体   繁体   English

如何从批处理文件调用VSTEST.CONSOLE.EXE

[英]How to call VSTEST.CONSOLE.EXE from batch file

I have unit test class library. 我有单元测试类库。

 ABC.dll

Now I have to execute it from .bat file: 现在我必须从.bat文件执行它:

 start %comspec% /k ""C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86 

After that I have to add my dll ... with it like 之后,我必须添加我的dll ...

VSTEST.CONSOLE.EXE C:/ABC.dll /logger:trx

How can i achieve this? 我怎样才能做到这一点? Please guide me kindly 请好心地指导我

Call vstest.console.exe within your batch file, and pass the DLL as a command line argument. 在批处理文件中调用vstest.console.exe ,然后将DLL作为命令行参数传递。

Example .BAT: 示例.BAT:

start cmd /k ""%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:/ABC.dll" /Logger:trx"

Note: Edit it, so the path to vs.test.console.exe is correct for whatever version of VS you have installed. 注意:编辑它,因此vs.test.console.exe的路径对于已安装的VS版本都是正确的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从VSTest.Console.exe将参数或选项传递给单元测试 - Pass argument or option to Unit Tests from VSTest.Console.exe 如何用vstest.console.exe生成线路覆盖率报告? - How to generate line coverage report with vstest.console.exe? 没有vstest.console.exe发现的xunit测试 - No xunit tests discovered by vstest.console.exe VSTest.Console.exe 无法加载文件或程序集 Microsoft.TestPlatform.CoreUtilities - VSTest.Console.exe Could not load file or assembly Microsoft.TestPlatform.CoreUtilities vstest.console.exe运行单元测试时,TraceSource消息未记录到trx文件中 - TraceSource messages not being logged to the trx file when unit tests are run by vstest.console.exe 如何使用VS2017 Vstest.console.exe运行VS 2015测试 - How to run VS 2015 tests using VS2017 Vstest.console.exe 如何使用 vstest.console.exe 在 cmd 中运行 Specflow 功能/场景? - How to run Specflow feature/scenarios in cmd using vstest.console.exe? 如果一个测试使用vstest.console.exe失败,如何停止测试? - How to stop test if one test fails using vstest.console.exe? vstest.console.exe仅为Moq.dll生成封面 - vstest.console.exe generate cover for only Moq.dll 是否可以在vstudio 2019中安装vstest.console.exe 2013? - Is it possible to install vstest.console.exe 2013 with vstudio 2019?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM