Parse the Visual Studio unit test result file (Trx file)

Source: Internet
Author: User

The Visual Studio unit test results can be easily seen in the test results window, or the TFS publish test results can be used:

 

However, if you want to use mstest.exe to run the test DLL or test list file) to parse the test result file, you need to face the complicated structure of the TRX file:

Every time a unit test is run, IDE will generate the testresults folder (this folder is the same as the test list file *. vsmdi) to save the TRX file:

I also wrote about parsing this file.CodeAnd generate an HTML report and send it by email. Recently, an open-source tool was found to generate a test report in HTML format that is easy to read. The address is as follows:

Http://trx2html.codeplex.com/

Download, decompress, run the trx2html.exe directly in the command line, and pass in the TRX test result file:

After the execution is complete, the test report in the .html file format will be generated under the same level directory:

Compare it with our test code:

The description content and error information are displayed in the report.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.