<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><br>
      Well, if you want the same config file as input to both your
      application and to CT:<br>
      <br>
      ct_run -config test.config -erl_args -config test.config<br>
      <br>
        /Peter<br>
      <br>
      On 2015-04-23 15:24, Roberto Ostinelli wrote:<br>
    </div>
    <blockquote
cite="mid:CAM5fRyp5MdUZYh3c1_S4HMVDh2Zb8x6Ovg1mvUn-52hwHPrZbg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div dir="ltr">Thank you Loïc, this works (i.e. `myapp` now
        starts) but now I'm unable to read this config file in <span
          style="font-size:12.8000001907349px">`myapp_SUITE.erl`.</span>
        <div><span style="font-size:12.8000001907349px"><br>
          </span></div>
        <div><span style="font-size:12.8000001907349px">`application:get_env(myapp,
            mykey)` and </span><span
            style="font-size:12.8000001907349px">`ct:get_config({myapp,
            mykey})` both </span><span
            style="font-size:12.8000001907349px">return `undefined`.</span></div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Thu, Apr 23, 2015 at 1:53 PM, Loïc
          Hoguin <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">ct_run
            -erl_args -config test.config
            <div>
              <div class="h5"><br>
                <br>
                On 04/23/2015 02:41 PM, Roberto Ostinelli wrote:<br>
              </div>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div>
                <div class="h5">
                  All,<br>
                  I've got an app `myapp` which uses a standard
                  `sys.config` file.<br>
                  I'd like to test it using Common Tests, with a test
                  configuration file.<br>
                  <br>
                  I'm passing the variable `-config test.config` to
                  ct_run.<br>
                  <br>
                  However, when I start my app from the Common Test
                  suite<br>
                  `myapp_SUITE.erl` then the app fails to start because
                  inside the app<br>
                  `application:get_env(myapp, mykey)` returns
                  `undefined`. I can, however,<br>
                  read this variable with `ct:get_config({myapp,
                  mykey})`.<br>
                  <br>
                  How am I supposed to use a custom `test.config` file
                  that is loaded in<br>
                  ct_run *and* read by the app itself?<br>
                  <br>
                  I've spent almost a day on this and I'm honestly 5
                  minutes away from<br>
                  dropping all this in the dustbin and using an external
                  test tool<br>
                  instead. Please help me stick to Erlang. :)<br>
                  <br>
                  r.<br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                </div>
              </div>
              _______________________________________________<br>
              erlang-questions mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:erlang-questions@erlang.org"
                target="_blank">erlang-questions@erlang.org</a><br>
              <a moz-do-not-send="true"
                href="http://erlang.org/mailman/listinfo/erlang-questions"
                target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
              <br>
              <span class="HOEnZb"><font color="#888888">
                </font></span></blockquote>
            <span class="HOEnZb"><font color="#888888">
                <br>
                -- <br>
                Loïc Hoguin<br>
                <a moz-do-not-send="true" href="http://ninenines.eu"
                  target="_blank">http://ninenines.eu</a><br>
              </font></span></blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>