【问题标题】:How to specify configuration file for common_test running tests with rebar如何为 common_test 使用 rebar 运行测试指定配置文件
【发布时间】:2013-07-13 08:22:45
【问题描述】:

我有一个通用测试套件,我需要使用 rebar 来执行它。通常是通过命令完成的

rebar ct suites=mysuite

但是有一个障碍。我的套件是必需的配置文件,我需要在执行测试时指定它。 ct_run 允许使用

ct_run -config <configfile>

有人知道如何使用 rebar 指定配置文件吗?

【问题讨论】:

    标签: erlang rebar common-test


    【解决方案1】:

    更新:使用rebar3 而不是rebar

    将以下内容添加到rebar.config

    {ct_opts, [
      {config, "./config/test.config"}
    ]}.
    

    更多详情here.

    【讨论】:

      【解决方案2】:

      我正在查看source code,您似乎无法指定一个名称。

      在您的test 目录中查找以下文件是硬编码的:

      • test.config 用于 -ct_config 选项
      • app.config 用于 -config 选项

      如果这对您不起作用,您可以对其进行修补以采用 rebar.config 参数。

      【讨论】:

      • 它对我有用。不幸的是,ct 配置文件 test.config 确实在 rebar 源代码中进行了编码。也许我会创建一个补丁,以便在命令行中设置配置。
      猜你喜欢
      • 2023-03-29
      • 2021-05-18
      • 1970-01-01
      • 2013-03-02
      • 1970-01-01
      • 1970-01-01
      • 2012-09-16
      • 2012-12-28
      • 1970-01-01
      相关资源
      最近更新 更多