[erlang-questions] starting an app with an app.config file

Roberto Ostinelli roberto@REDACTED
Mon Oct 15 00:56:03 CEST 2012


Dear list,

I have an application set up with the standard structure:

-- myproject
   rebar.config
   *app.config*
   |-- apps
       |-- myapp
           |--src
              ...
           |--test
              myapp_SUITE.erl
   |-- deps
       |-- dep1
       |-- dep2
   |-- ...


Please note app.config in there. Everything perfectly fine if I start myapp.

However, I'm trying to use Common Tests, and I start myapp in
myapp_SUITE.erl during init:

init_per_suite(Config) ->
ok = application:start(myapp),
Config.

During startup, myapp tries to access config variables:

{ok, Port} = application:get_env(myapp, port),

This crashes in test, because application:get_env(myapp, port) returns
undefined. This basically means that myapp does not load app.config.

How can I solve this?

Thank you,

r.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121014/f5a5bffd/attachment.htm>


More information about the erlang-questions mailing list