Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any .runsettings documentation?

I'm looking for documentation for .runsettings files as used with vstest. Is there an xsd?

I can't seem to find much except for a few example files in the msdn documentation.

like image 977
haymansfield Avatar asked Apr 16 '13 13:04

haymansfield


People also ask

What is a .runsettings file?

runsettings file is to customize code coverage analysis. Run settings files can be used to configure tests that are run from the command line, from the IDE, or in a build workflow using Azure Test Plans or Team Foundation Server (TFS). Run settings files are optional.

How do I generate code coverage in Runsettings?

Add a run settings file to your solution. In Solution Explorer, on the shortcut menu of your solution, choose Add > New Item, and select XML File. Save the file with a name such as CodeCoverage. runsettings.

How do I enable analyze code coverage in Visual Studio 2022?

Starting in Visual Studio 2022 Update 2, you can enable faster code coverage test results by selecting Tools > Options > Environment > Preview Features, then selecting Code coverage experience improvements, and then restarting Visual Studio.


2 Answers

Runsettings (VS2012) are similar to testsettings (VS2010) where testsettings is specific to tests written for MSTest. VS2012 supports settings for different adapters. As such, the schema isn't a closed system so an XSD would not be comprehensive.

This MSDN article lists some high level details (https://msdn.microsoft.com/en-us/library/jj635153.aspx) for the elements in the runsettings file.

Here's a snippet from that article.

<?xml version="1.0" encoding="utf-8"?> <RunSettings>    <!-- Configurations that affect the Test Framework -->    <RunConfiguration>      <MaxCpuCount>1</MaxCpuCount>      <!-- Path relative to solution directory -->      <ResultsDirectory>.\TestResults</ResultsDirectory>       <!-- [x86] | x64          - You can also change it from menu Test, Test Settings, Default          Processor Architecture -->      <TargetPlatform>x86</TargetPlatform>       <!-- Framework35 | [Framework40] | Framework45 -->      <TargetFrameworkVersion>Framework40</TargetFrameworkVersion>       <!-- Path to Test Adapters -->      <TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>    </RunConfiguration>     <!-- Configurations for data collectors -->    <DataCollectionRunSettings>      <DataCollectors>         <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">            <Configuration>              <CodeCoverage>                <ModulePaths>                  <Exclude>                     <ModulePath>.*CPPUnitTestFramework.*</ModulePath>                  </Exclude>                </ModulePaths>              </CodeCoverage>            </Configuration>         </DataCollector>      </DataCollectors>   </DataCollectionRunSettings>    <!-- Parameters used by tests at runtime -->   <TestRunParameters>     <Parameter name="webAppUrl" value="http://localhost" />     <Parameter name="webAppUserName" value="Admin" />     <Parameter name="webAppPassword" value="Password" />   </TestRunParameters>    <!-- Adapter Specific sections -->   <!-- MSTest adapter -->   <MSTest>      <MapInconclusiveToFailed>True</MapInconclusiveToFailed>      <CaptureTraceOutput>false</CaptureTraceOutput>      <DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>      <DeploymentEnabled>False</DeploymentEnabled>      <AssemblyResolution>         <Directory Path>"D:\myfolder\bin\" includeSubDirectories="false"/>      </AssemblyResolution>   </MSTest>  </RunSettings> 
like image 114
bryanbcook Avatar answered Sep 24 '22 05:09

bryanbcook


I found further information on runsettings (specific to code coverage) here:

http://msdn.microsoft.com/en-us/library/jj159530%28v=vs.110%29.aspx

like image 38
haymansfield Avatar answered Sep 21 '22 05:09

haymansfield