user1040933
user1040933

Reputation: 287

About integrate lager/rebar/common_test

I am using rebar to do UT in my Erlang project.

Before introducing lager, everything is OK and I can run common_test like below:

1) Run all the test suites

E:\>.\rebar ct 

2) Run a specified test suite

E:\>.\rebar ct suites=client_app

But after introducing lager, I can only run all the test suites as a whole:

1)

E:\>.\rebar ct
==> lager (ct)
DONE.
Testing deps.lager: TEST COMPLETE, 0 ok, 0 failed of 0 test cases

If I specify only one test suite, it will fail:

2)

E:\>.\rebar ct suites=client_app
==> lager (ct)
ERROR: Suite client_app not found

Is there any solution? Thanks!

The following is my rebar.config:

%% -*- erlang -*-

{cover_enabled, true}.

{test_deps, false}.

{show_cmd, true}.

{test_node_name, "[email protected]"}.

{clean_files, ["logs"]}.

{erl_opts, [debug_info,{d,'TEST'}, {i, "include"}, {src_dirs, ["src"]}, {parse_transform, lager_transform}]}.

{deps_dirs, ["deps"]}.
{deps, [{lager, "0.9.4", {git, "http://github.com/basho/lager.git", {tag, "0.9.4"}}}]}.
{sub_dirs, ["rel"]}.                          
{edoc_opts,[{packages,false},{subpackages,false}]}.

Upvotes: 1

Views: 741

Answers (1)

legoscia
legoscia

Reputation: 41618

Try running rebar with skip_deps=true:

./rebar ct skip_deps=true suites=client_app

That should make rebar not descend into lager, and thus it wouldn't look for a Common Test suite called client_app in that directory.

Upvotes: 1

Related Questions