Removing Standard Output Messages from Console Window

一世执手 提交于 2020-01-06 17:25:33

问题


I'm using vstest to execute tests on local.

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe\" "C:\Debug\Solution.dll /Tests:VerifyTest1,VerifyTest2 /Logger:trx"

And over console i receive output something like this -

Passed   VerifyTest1
Failed   VerifyTest2
Standard Output Messages:

TestContext Messages:
1/29/2016 21:50:00  -  START  -  START : [VerifyTest2] 
   1/29/2016 21:50:00  -  INFO  -  Operating System - Microsoft Windows 10 Enterprise 
   1/29/2016 21:50:00  -  INFO  -  Test Environment - Test1 
   1/29/2016 21:50:00  -  INFO  -  Test Environment - Test1 
   1/29/2016 21:50:00  -  INFO  -  File updated 
   1/29/2016 21:50:02  -  INFO  -  Login Complete! via UI API's
   1/29/2016 21:50:03  -  INFO  -  eb481527-49f6-49bc-a9ca-9ccf4e10d12a submitted successfully.
   1/29/2016 21:50:11  -  PASS  -  Return created through UI
   1/29/2016 21:50:11  -  INFO  -  Checking Process launched or NOT
   1/29/2016 21:50:11  -  INFO  -  Process: My.CommonUIFramework.Shell is launched
   1/29/2016 21:50:11  -  INFO  -  Terminating the Process: My.CommonUIFramework.Shell
   1/29/2016 21:50:11  -  INFO  -  Checking Process launched or NOT
   1/29/2016 21:50:11  -  INFO  -  Process: My.Xion.DataMigration.UI is NOT launched
   1/29/2016 21:50:12  -  INFO  -  Launched the Application : My.CommonUIFramework.Shell
   1/29/2016 21:50:12  -  INFO  -  Checking Process launched or NOT 

Now, i don't want the debug trace with all the info when a test fails on Console. I just want passed or failed result on Console. Is there a way to do that. I know that i can see the result on trx file but i just wanted to know is there a way to suppress the debug trace or Standard Output Messages on Console.


回答1:


You May Want to Disable your trace Logs. You can do it thru multiple channels. Try as mentioned in here based on ur VSTS & .Net version. https://msdn.microsoft.com/en-us/library/jj159363(v=vs.120).aspx

0 is the setting for disabling traces.




回答2:


Using MSTest instead of VSTest solved the purpose of my problem.



来源:https://stackoverflow.com/questions/35125183/removing-standard-output-messages-from-console-window

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