本文介绍了.runsettings和代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


VS 2015 entreprise。版本14.0.25431.01更新3.
$


使用.runsettings,是否有人知道如何为测试后生成的.coverage指定名称?


确实,它有一个丑陋的名字,我只想在data.coverage中将其重命名为.localsettings。


我正在使用vstest .console.exe。


同样,当我使用MSTest.exe时,它用于生成"In"。文件夹和"Out"文件夹,并复制所有二进制文件。


mstest.console.exe只生成一个In文件夹,没有包含二进制文件的Out文件夹。


需要帮助这是我的.runsettings:


<?xml version =" 1.0" encoding =" utf-8"?>

< RunSettings>

  <! - 影响测试框架的配置 - >

  < RunConfiguration>

    < MaxCpuCount> 4< / MaxCpuCount>

    <! - 相对于解决方案目录的路径 - >

    < ResultsDirectory> .\TestResults< / ResultsDirectory>



    <! - [x86] | x64

      - 您也可以从菜单测试,测试设置,默认处理器架构中更改它 - >

    < TargetPlatform> x86< / TargetPlatform>



    <! - Framework35 | [Framework40] | Framework45 - >

    < TargetFrameworkVersion> Framework45< / TargetFrameworkVersion>

  < / RunConfiguration>



  <! - 数据收集器的配置 - >

  < DataCollectionRunSettings>

    < DataCollectors>

      < DataCollector friendlyName =" Code Coverage" URI = QUOT; datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName =" Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector,Microsoft.VisualStudio.TraceCollector,
Version = 11.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a">

   &NBSP;&NBSP;&NBSP;&NBSP;&NBSP; <配置>

          < CodeCoverage>

            < ModulePaths>

              < Include>&
                < ModulePath> *****。exe< / ModulePath>

              < / Include>&
            < / ModulePaths>&
           

            <! - 我们建议您不要更改以下值: - >

            < UseVerifiableInstrumentation> True< / UseVerifiableInstrumentation>

            < AllowLowIntegrityProcesses> True< / AllowLowIntegrityProcesses>

            < CollectFromChildProcesses> True< / CollectFromChildProcesses>

            < CollectAspDotNet> False< / CollectAspDotNet>



          < / CodeCoverage>

        < / Configuration>

      < / DataCollector>

    < / DataCollectors>

  < / DataCollectionRunSettings>

< / RunSettings>


谢谢。


Gantz

解决方案


Hello,

VS 2015 entreprise. Version 14.0.25431.01 Update 3.

With .runsettings, does anybody know how you can specify a name for the .coverage generated after tests ?

Indeed, it has an ugly name, and I just would like to rename it like with .localsettings, in data.coverage.

I'm using vstest.console.exe.

And as well, when I used MSTest.exe it used to generate a "In" folder, and an "Out" folder, and copy all binaries inside.

mstest.console.exe only generates a In folder, and no Out folder with binaries.

NEED HELP !

Here is my .runsettings:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <!-- Configurations that affect the Test Framework -->
  <RunConfiguration>
    <MaxCpuCount>4</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>Framework45</TargetFrameworkVersion>
  </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>
              <Include>
                <ModulePath>*****.exe</ModulePath>
              </Include>
            </ModulePaths>
           
            <!-- We recommend you do not change the following values: -->
            <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
            <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
            <CollectFromChildProcesses>True</CollectFromChildProcesses>
            <CollectAspDotNet>False</CollectAspDotNet>

          </CodeCoverage>
        </Configuration>
      </DataCollector>
    </DataCollectors>
  </DataCollectionRunSettings>
</RunSettings>

Thanks.

Gantz

解决方案


这篇关于.runsettings和代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-30 13:40