Visual Studio 2015: Enabling MSTest Magazine

I would like to generate a test log to a file, and I found this post on the Internet that shows how to enable MSTest logging, but it doesn't seem to work:

Here are the steps you must follow to enable MSTest logs.

  • Change to the MSTest installation directory through the administrator command line. (usually the installation directory is similar to C: \ Program Files \ Microsoft Visual Studio 11.0 \ Common7 \ IDE).

  • Open the mstest configuration file (MSTest.exe.config) and add a fragment similar to the one shown below in the node configuration. Make sure that the path you specify exists and that you have the appropriate permissions for it.

**

<system.diagnostics>
    <trace autoflush="true" indentsize="4">
        <listeners>                   
           <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\temp\MSTest.log" />
        </listeners>
    </trace>
    <switches>
        <!-- You must use integral values for "value".  Use 0 for off, 1 for error, 2 for warn, 3 for info, and 4 for verbose. -->
        <add name="EqtTraceLevel" value="4" />
    </switches>
</system.diagnostics>
</configuration>

**

  1. Save the configuration file and try running the test.

After that, a log file on the specified path should be generated.

- ?

+4
2

  <system.diagnostics>
    <switches>
      <!-- You must use integral values for "value".
           Use 0 for off, 1 for error, 2 for warn, 3 for info, and 4 for verbose. -->
      <add name="EqtTraceLevel" value="4" />
    </switches>
  </system.diagnostics> 

.....

    <add key="CreateTraceListener" value="yes"/>
  </appSettings>
</configuration>
+1

, , . MSTest VStest.

cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\
.\MSTest.exe /testcontainer:C:\temp\MyTests.dll /resultsfile:testResults.trx

, testResults.trx

-1

Source: https://habr.com/ru/post/1625258/


All Articles