简体   繁体   中英

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, "localhost@127.0.0.1"}.

{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}]}.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM