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

738 views Asked by At

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?

2

There are 2 answers

0
sysoff On BEST ANSWER

Add in apps/B/rebar.config

{lib_dirs, [
    ".."
]}.

or

{ct_extra_params, "-pa ../A/ebin"}.
0
Marutha On

IMO, if B depends on A, I would have two separate tests. One for A and mention it deps section of B of rebar config and write separate test cases for B and run only for B so that application A modules would be automatically taken care by rebar.