diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2016-09-20 07:04:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-20 07:04:51 -0400 |
commit | 69a9cf8a6d01b9f4f3bc526abfd446d1e28e1b79 (patch) | |
tree | e5b38084fe97ac2b1807b88c338cf05faa47fa3a | |
parent | c001c09dd775a4dc337d5f57affa5121d947b195 (diff) | |
parent | f653d4dffec599f0d488aef30430e9761fc8955b (diff) |
Merge pull request #1332 from erlang/rebar-1327
compile + cover compile prior to analyzing coverdata
-rw-r--r-- | src/rebar_prv_cover.erl | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/rebar_prv_cover.erl b/src/rebar_prv_cover.erl index 401c331..b62a796 100644 --- a/src/rebar_prv_cover.erl +++ b/src/rebar_prv_cover.erl @@ -15,7 +15,7 @@ -include("rebar.hrl"). -define(PROVIDER, cover). --define(DEPS, [app_discovery]). +-define(DEPS, [lock]). %% =================================================================== %% Public API @@ -84,6 +84,20 @@ reset(State) -> {ok, State}. analyze(State) -> + %% modules have to be compiled and then cover compiled + %% in order for cover data to be reloaded + %% this maybe breaks if modules have been deleted + %% since code coverage was collected? + case rebar_prv_compile:do(State) of + %% successfully compiled apps + {ok, S} -> + ok = cover_compile(S, apps), + do_analyze(State); + %% this should look like a compiler error, not a cover error + Error -> Error + end. + +do_analyze(State) -> ?INFO("Performing cover analysis...", []), %% figure out what coverdata we have CoverDir = cover_dir(State), |