diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2017-01-30 22:11:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 22:11:41 -0500 |
commit | 267f2311dc4c9f3b4844e5c3769b60803c5e0b28 (patch) | |
tree | 2f569849d69e92c6735168eb358e89b4108cbf0a /test | |
parent | da1beb88e390d632cca4125429e704148511baf8 (diff) | |
parent | 9b099f41d6100f87dcb334d4acdcfbcdac2c97f1 (diff) |
Merge pull request #1463 from varnerac/cover_exclude_apps
Allow exclusion of apps in cover
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_cover_SUITE.erl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/rebar_cover_SUITE.erl b/test/rebar_cover_SUITE.erl index 4192f4a..cc06c95 100644 --- a/test/rebar_cover_SUITE.erl +++ b/test/rebar_cover_SUITE.erl @@ -13,7 +13,7 @@ index_written/1, flag_verbose/1, config_verbose/1, - excl_mods/1, + excl_mods_and_apps/1, coverdata_is_reset_on_write/1]). -include_lib("common_test/include/ct.hrl"). @@ -38,7 +38,7 @@ all() -> root_extra_src_dirs, index_written, flag_verbose, config_verbose, - excl_mods, coverdata_is_reset_on_write]. + excl_mods_and_apps, coverdata_is_reset_on_write]. flag_coverdata_written(Config) -> AppDir = ?config(apps, Config), @@ -210,7 +210,7 @@ config_verbose(Config) -> true = filelib:is_file(filename:join([AppDir, "_build", "test", "cover", "index.html"])). -excl_mods(Config) -> +excl_mods_and_apps(Config) -> AppDir = ?config(apps, Config), Name1 = rebar_test_utils:create_random_name("relapp1_"), @@ -221,18 +221,25 @@ excl_mods(Config) -> Vsn2 = rebar_test_utils:create_random_vsn(), rebar_test_utils:create_app(filename:join([AppDir, "apps", Name2]), Name2, Vsn2, [kernel, stdlib]), + Name3 = rebar_test_utils:create_random_name("excludeme_"), + Vsn3 = rebar_test_utils:create_random_vsn(), + rebar_test_utils:create_app(filename:join([AppDir, "apps", Name3]), Name3, Vsn3, [kernel, stdlib]), + Mod1 = list_to_atom(Name1), Mod2 = list_to_atom(Name2), + Mod3 = list_to_atom(Name3), RebarConfig = [{erl_opts, [{d, some_define}]}, - {cover_excl_mods, [Mod2]}], + {cover_excl_mods, [Mod2]}, + {cover_excl_apps, [Name3]}], rebar_test_utils:run_and_check(Config, RebarConfig, ["eunit", "--cover"], - {ok, [{app, Name1}, {app, Name2}]}), + {ok, [{app, Name1}, {app, Name2}, {app, Name3}]}), {file, _} = cover:is_compiled(Mod1), - false = cover:is_compiled(Mod2). + false = cover:is_compiled(Mod2), + false = cover:is_compiled(Mod3). coverdata_is_reset_on_write(Config) -> AppDir = ?config(apps, Config), |