Is there any .runsettings documentation?
Asked Answered
N

3

39

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.

Neisse answered 16/4, 2013 at 13:56 Comment(0)
O
15

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>
Offenbach answered 17/4, 2013 at 11:36 Comment(4)
Not a complete answer but is helpful.Neisse
The example behind the link is broken. It has a syntax error in line 54Corenda
The link wasn't broken for me. I've added a snippet from that page for future reference.Offenbach
Keep in mind that for the AssemblyResolution Directory the path property must be lower case! Thats the important clue.Jariah
N
2

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

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

Neisse answered 28/10, 2013 at 15:52 Comment(0)
N
-1

A more recent documentation is available here: https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file

Nippers answered 15/4 at 9:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.