36

我正在寻找与 vstest 一起使用的 .runsettings 文件的文档。有xsd吗?

除了 msdn 文档中的一些示例文件外,我似乎找不到太多内容。

4

2 回答 2

13

Runsettings (VS2012) 类似于 testsettings (VS2010),其中 testsettings 特定于为 MSTest 编写的测试。VS2012 支持不同适配器的设置。因此,模式不是一个封闭的系统,因此 XSD 不会是全面的。

此 MSDN 文章列出了 runsettings 文件中元素的一些高级详细信息 ( https://msdn.microsoft.com/en-us/library/jj635153.aspx )。

这是那篇文章的一个片段。

<?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>
于 2013-04-17T11:36:42.480 回答
3

我在这里找到了有关运行设置(特定于代码覆盖率)的更多信息:

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

于 2013-10-28T15:52:14.223 回答