4

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 -config <configfile>

Does anybody know how can I specify config file with rebar?

Danil Onishchenko
  • 2,030
  • 11
  • 19

2 Answers2

6

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.config for the -ct_config option
  • app.config for the -config option

If that doesn't work for you, you could probably patch it to take a rebar.config parameter instead.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
kjw0188
  • 3,625
  • 16
  • 28
  • 1
    It works for me. Unfortunatly it is true that ct config file test.config is harcoded in rebar source code. Perhaps I'll create a patch to have possibility to set a config in command line. – Danil Onishchenko Jul 17 '13 at 03:42
3

Update: use rebar3 instead of rebar

Add following to rebar.config:

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

More details here.

Bazi
  • 311
  • 1
  • 4
  • 10