How to specify the location for the unit test results in VS 2010?

前端 未结 2 793
名媛妹妹
名媛妹妹 2021-01-02 10:37

I use VS2010 for unit testing. Does anyone know how to specify the location of where VS 2010 put its TestResults? By default it put a TestResults folder in the solution fo

相关标签:
2条回答
  • 2021-01-02 11:15

    MSTest.exe will generate results in the current folder as kroonwijk states, but you can override that with the /resultsfile command line switch by specifying the output filename in a different folder, it will also deploy a subfolder with the test files to the same location.

    For example "/resultsfile:c:\TestResults\mstestreport.trx" will override the default deployment folder and also override anything that is in the <deployment> tag in the settings file.

    0 讨论(0)
  • 2021-01-02 11:20

    Currently, this is not possible to control from within the IDE, see http://social.msdn.microsoft.com/Forums/en/vststest/thread/4ff650e1-a99a-4bd4-8311-6007f2a6e16e.

    However, if you can use MSTEST.EXE from the commandline, it will use the current folder to generate the TestResults folder in.

    Update:

    Found this in http://blogs.msdn.com/b/vstsqualitytools/archive/2010/10/24/test-agent-test-controller-and-mstest-faq.aspx:

    How to customize the default deployment directory?

    You can change the default deployment folder by editing the test settings file in the XML editor:

    <Deployment userDeploymentRoot="C:\TestResults" useDefaultDeploymentRoot ="false" /> 
    

    Note that ,if the test settings is modified by XML edit (instead of using the default editor) VS need to be closed and reopened ( since the editing is done in XML , the changes will not be updated in the loaded settings.)

    Best regards, Marco Kroonwijk

    0 讨论(0)
提交回复
热议问题