<p>Hi Roberto,</p>
<p>What about adding the app(s) to your appname.rel script in release/x.y.z and then using systools:make_script to generate the boot script.</p>
<p>That seems to work for me, anyway</p>
<p>-Jesse</p>
<p>--<br>
Jesse Gumm<br>
Owner, Sigma Star Systems<br>
414.940.4866 || <a href="http://sigma-star.com">sigma-star.com</a> || @jessegumm</p>
<div class="gmail_quote">On Oct 20, 2012 4:00 PM, "Roberto Ostinelli" <<a href="mailto:roberto@widetag.com">roberto@widetag.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br></div><div>this isn't working. From the docs:</div><div><br></div><div><div><font face="courier new, monospace">load(AppDescr) -> ok | {error, Reason}</font></div><div><font face="courier new, monospace">load(AppDescr, Distributed) -> ok | {error, Reason}</font></div>
<div><br></div><div>So <font face="courier new, monospace">application:load/2</font> actually is not reading from a config file.</div><div><br></div><div>Any other ideas?</div><div><br></div><div>r.</div><br><br><div class="gmail_quote">
On Sun, Oct 14, 2012 at 10:40 PM, Andrew Gopienko <span dir="ltr"><<a href="mailto:gopienko@gmail.com" target="_blank">gopienko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>From my eunit tests<br><br> SaslSpec = [{errlog_type, error}],<br> case application:load({application,sasl,SaslSpec}) of<br> {error,{already_loaded,_}} -> ok;<br> ok -><br> ok = application:start(sasl),<br>
<br><br><br><div class="gmail_quote">2012/10/15 Roberto Ostinelli <span dir="ltr"><<a href="mailto:roberto@widetag.com" target="_blank">roberto@widetag.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
<div>To extend: I can ensure that <font face="courier new, monospace">app.config</font> is used:</div><div><br></div><div><ul><li>when in development mode, by configuring it manually:</li></ul><div><div><font face="courier new, monospace">erl -pa apps/*/ebin -pa deps/*/ebin \</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap"> </span>-boot start_sasl \</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap"> </span>-config app \</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap"> </span>-s myapp</font></div></div></div><div><ul><li>when it is packaged as a release (i believe this can be managed by reltool)</li>
</ul></div><div>But how can I set <font face="courier new, monospace">myapp</font> to use it in common tests?</div><div><div><div><br></div><br><br><div class="gmail_quote">On Sun, Oct 14, 2012 at 3:56 PM, Roberto Ostinelli <span dir="ltr"><<a href="mailto:roberto@widetag.com" target="_blank">roberto@widetag.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear list,<div><br></div><div>I have an application set up with the standard structure:</div><div><br></div><div><pre style="margin-top:15px;margin-bottom:0px!important;padding:6px 10px;border:1px solid rgb(204,204,204);font-size:13px;font-family:Consolas,'Liberation Mono',Courier,monospace;background-color:rgb(248,248,248);line-height:19px;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51)">
<code style="margin:0px;padding:0px;border:none;font-size:12px;font-family:Consolas,'Liberation Mono',Courier,monospace;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">-- myproject
rebar.config
<b>app.config</b>
|-- apps
|-- myapp
|--src
...
|--test
myapp_SUITE.erl
|-- deps
|-- dep1
|-- dep2
|-- ...</code></pre></div><div><br></div><div>Please note <font face="courier new, monospace">app.config</font> in there. Everything perfectly fine if I start <font face="courier new, monospace">myapp</font>.</div><div>
<br></div><div>However, I'm trying to use Common Tests, and I start <font face="courier new, monospace">myapp</font> in <font face="courier new, monospace">myapp_SUITE.erl</font> during init:</div><div><br></div><div>
<div><font face="courier new, monospace">init_per_suite(Config) -></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap"> </span>ok = application:start(myapp),</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap"> </span>Config.</font></div></div><div><br></div><div>During startup, <font face="courier new, monospace">myapp</font> tries to access config variables:</div>
<div><br></div><div><font face="courier new, monospace">{ok, Port} = application:get_env(myapp, port),</font></div><div><br></div><div>This crashes in test, because<font face="courier new, monospace"> application:get_env(myapp, port)</font> returns <font face="courier new, monospace">undefined</font>. This basically means that <font face="courier new, monospace">myapp</font> does not load <font face="courier new, monospace">app.config</font>.</div>
<div><br></div><div>How can I solve this?</div><div><br></div><div>Thank you,</div><div><br></div><div>r.</div>
</blockquote></div><br>
</div></div><br></div></div>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br>
</blockquote></div><br></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div>