【问题标题】:Unit test coverage using dotCover command line tool(JetBrains) - Is it possible to run this tool with x64 dll tests?使用 dotCover 命令行工具(JetBrains)的单元测试覆盖率 - 是否可以使用 x64 dll 测试运行此工具?
【发布时间】:2018-06-11 13:02:15
【问题描述】:

我正在使用 dotCover 命令行工具(JetBrains)https://www.jetbrains.com/dotcover/download/#section=commandline

我正在阅读此文档 https://www.jetbrains.com/help/dotcover/Running_Coverage_Analysis_from_the_Command_LIne.html

我有一个逻辑 dll - x64 编译。
我有一个测试 dll(AppTests 测试项目)-x64 编译
我正在使用以下参数在我的解决方案项目文件夹上创建 coverage.xml

<AnalyseParams>
      <TargetExecutable>C:\Program Files (x86)\Microsoft Visual Studio12.0\Common7\IDE\MSTest.exe</TargetExecutable> 
      <TargetArguments>D:\Projects\TheApplication\bin\Debug\AppTests.dll</TargetArguments>
      <Output>AppCoverageReport.html</Output>
      <ReportType>html</ReportType>
</AnalyseParams>

我在 cmd 中输入“dotcover analyze coverage.xml”

我得到了流动的错误: “如果您将测试项目程序集构建为 64 位程序集,则无法加载。当您构建测试项目程序集时,请为平台选择“任何 CPU”。要在 64 位处理器上以 64 位模式运行测试,您必须在“主机”选项卡中更改测试设置才能在 32 位进程中运行测试”

我无法将我的 logic.dll 和 AppTests.dll 构建到“任何 cpu”。

我读了这篇文章: How do I get unit tests to run on a x64 platform

但就我而言,我是从 dot cover 命令行工具而不是从 Visual Studio UI 运行测试。

我能做什么?还有其他选择吗?

谢谢。

【问题讨论】:

    标签: unit-testing resharper code-coverage jetbrains-ide dotcover


    【解决方案1】:

    我从 Resharper 支持人员那里得到了答案,它解决了我的问题,所以我正在分享它。

    <AnalyseParams>
         <TargetExecutable>C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe</TargetExecutable> 
         <TargetArguments>D:\Projects\TheApplication\bin\Debug\AppTests.dll /Settings:"<your path>\runsetting.xml"</TargetArguments>
         <Output>AppCoverageReport.html</Output>
         <ReportType>html</ReportType>
    </AnalyseParams>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-17
      • 1970-01-01
      • 1970-01-01
      • 2017-04-09
      • 1970-01-01
      • 2018-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多