diff options
author | alisdair sullivan <alisdair.sullivan@askuity.com> | 2015-11-01 14:10:00 -0800 |
---|---|---|
committer | alisdair sullivan <alisdair.sullivan@askuity.com> | 2015-11-01 14:11:18 -0800 |
commit | d8be03ab6a75b2f585487118ae38085c2f758d3c (patch) | |
tree | f08fe831fe319cede03edcd70113805665b4148b /test | |
parent | e72e46fc9d23d8467cd58d1728175ae59d2a7c44 (diff) |
fixes for cover under new compiler/eunit/ct
* only try to cover compile directories that actually exist
* recover from failures where source files don't contain required
attributes for cover compilation and print warning
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_cover_SUITE.erl | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/test/rebar_cover_SUITE.erl b/test/rebar_cover_SUITE.erl index ba078c2..a838d7d 100644 --- a/test/rebar_cover_SUITE.erl +++ b/test/rebar_cover_SUITE.erl @@ -72,7 +72,7 @@ basic_extra_src_dirs(Config) -> Name = rebar_test_utils:create_random_name("cover_extra_"), Vsn = rebar_test_utils:create_random_vsn(), - rebar_test_utils:create_eunit_app(AppDir, Name, Vsn, [kernel, stdlib]), + rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]), ExtraSrc = io_lib:format("-module(~ts_extra).\n-export([ok/0]).\nok() -> ok.\n", [Name]), @@ -86,8 +86,11 @@ basic_extra_src_dirs(Config) -> ["eunit", "--cover"], {ok, [{app, Name}]}), - Mod = list_to_atom(lists:flatten(io_lib:format("~ts_extra", [Name]))), - {file, _} = cover:is_compiled(Mod). + Mod = list_to_atom(Name), + {file, _} = cover:is_compiled(Mod), + + ExtraMod = list_to_atom(lists:flatten(io_lib:format("~ts_extra", [Name]))), + {file, _} = cover:is_compiled(ExtraMod). release_extra_src_dirs(Config) -> AppDir = ?config(apps, Config), @@ -120,10 +123,15 @@ release_extra_src_dirs(Config) -> ["eunit", "--cover"], {ok, [{app, Name1}, {app, Name2}]}), - Mod1 = list_to_atom(lists:flatten(io_lib:format("~ts_extra", [Name1]))), + Mod1 = list_to_atom(Name1), {file, _} = cover:is_compiled(Mod1), - Mod2 = list_to_atom(lists:flatten(io_lib:format("~ts_extra", [Name2]))), - {file, _} = cover:is_compiled(Mod2). + Mod2 = list_to_atom(Name2), + {file, _} = cover:is_compiled(Mod2), + + ExtraMod1 = list_to_atom(lists:flatten(io_lib:format("~ts_extra", [Name1]))), + {file, _} = cover:is_compiled(ExtraMod1), + ExtraMod2 = list_to_atom(lists:flatten(io_lib:format("~ts_extra", [Name2]))), + {file, _} = cover:is_compiled(ExtraMod2). root_extra_src_dirs(Config) -> AppDir = ?config(apps, Config), @@ -147,6 +155,11 @@ root_extra_src_dirs(Config) -> ["eunit", "--cover"], {ok, [{app, Name1}, {app, Name2}]}), + Mod1 = list_to_atom(Name1), + {file, _} = cover:is_compiled(Mod1), + Mod2 = list_to_atom(Name2), + {file, _} = cover:is_compiled(Mod2), + {file, _} = cover:is_compiled(extra). index_written(Config) -> |