简体   繁体   English

如何使用rebar为common_test运行测试指定配置文件

[英]How to specify configuration file for common_test running tests with rebar

I have a common test suite and I need to perform it with rebar . 我有一个通用的测试套件,我需要用钢筋来执行它。 Usually it is done with command 通常用命令完成

rebar ct suites=mysuite

But there is an obstacle. 但是有一个障碍。 My suite is required configuration file and I need to specify it when I am performing tests. 我的套件是必需的配置文件,我需要在执行测试时指定它。 ct_run allows to do it with ct_run允许这样做

ct_run -config <configfile>

Does anybody know how can I specify config file with rebar ? 有谁知道如何用钢筋指定配置文件?

I'm looking at the source code , and it doesn't look like you can specify one by name. 我正在查看源代码 ,看起来你不能按名称指定一个。

It's hard coded to look in your test directory for the following files: 在您的test目录中查找以下文件的硬编码:

  • test.config for the -ct_config option test.config用于-ct_config选项
  • app.config for the -config option app.config用于-config选项

If that doesn't work for you, you could probably patch it to take a rebar.config parameter instead. 如果这对您不起作用,您可以修改它以取代rebar.config参数。

Update: use rebar3 instead of rebar 更新:使用rebar3代替rebar

Add following to rebar.config : 将以下内容添加到rebar.config

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

More details here . 更多细节在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM