erlangrebarcommon-test

How do I use "rebar ct" with a two application node?


I'm using rebar to compile my application. Actually, it's two applications:

deps/
apps/A/
apps/B/
apps/B/suites

...where B depends on A. This is correctly configured in apps/B/src/B.app.src. However, when I attempt to run rebar ct, it fails to test B, reporting that it can't find A.app.

Running rebar ct in verbose mode shows that it's setting the code search path (-pa) to include apps/B/ebin, and deps/foo/ebin, deps/bar/ebin, etc.

It is not including apps/A/ebin.

How do I use Common Test to test an Erlang "application" that's made up of multiple applications?


Solution

  • Add in apps/B/rebar.config

    {lib_dirs, [
        ".."
    ]}.
    

    or

    {ct_extra_params, "-pa ../A/ebin"}.