【问题标题】:How do I run nunit 2 tests from nunit-console from the command line?如何从命令行从 nunit-console 运行 nunit 2 测试?
【发布时间】:2019-03-22 17:47:42
【问题描述】:

我从https://github.com/nunit/nunit-console 构建了 nunit-console 和来自 https://github.com/nunit/nunit-v2-framework-driver 的 nunit-v2-framework-driver 引用来自 https://github.com/nunit-legacy/nunitv2/releases/download/2.7.0/NUnit-2.7.0-src.zip 的 nunit-2.7 程序集

我正在为我构建的每个程序集直接从命令行显式调用单编译器mcs(以便我知道引擎盖下发生了什么)。生成的 nunit-console 程序集可以按预期运行 nunit v3 测试。

我有一个包含大量 nunit 2 测试的旧项目,并且了解 nunit-v2-framework-driver 可用于通过 nunit-console 运行 nunit 2 测试。

我不知道该怎么做 - 我怎样才能让 nunit-console 拿起 nunit-v2-framework-driver 扩展?引用程序集似乎还不够。

【问题讨论】:

    标签: c# nunit nunit-console


    【解决方案1】:

    如果您是从源代码构建,则需要添加一个.addins 文件,以将引擎指向您拥有扩展程序的位置。

    .addins 文件应该位于 nunit.engine.dll 程序集旁边,并且只包含 nunit.v2.driver.addins 的路径 - 它应该包含在您的 nunit-v2-framework-driver 构建中。 (或者,直接指向nunit.v2.driver.dll 的路径)

    作为外观示例,您可能希望从 GitHub 发布页面下载打包在 NUnit.Console-3.9.0.zip 中的控制台,并查看 nunit.bundle.addins 文件及其周围的文件结构。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-03
      • 1970-01-01
      • 2021-09-02
      • 1970-01-01
      • 2012-02-25
      • 2011-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多