erlang.mk icon indicating copy to clipboard operation
erlang.mk copied to clipboard

cover-report fails if you have a module named 'coverage'

Open rlipscombe opened this issue 5 years ago • 5 comments

tbf, this is an issue with cover.erl, where cover:analyse is a bag of ambiguity. But I was wondering whether we could filter it out in erlang.mk?

Somewhere around line 7093:

Report = [begin {ok, R} = cover:analyse(M, module), R end || M <- Ms],

could be:

Report = [begin {ok, R} = cover:analyse(M, module), R end || M <- Ms, M =/= coverage, M =/= calls],

...unless you've got a better suggestion?

rlipscombe avatar Jun 24 '19 22:06 rlipscombe

lol

Fixing cover would be great, if possible. I don't mind adding this as a workaround otherwise but it needs a test case.

essen avatar Jun 25 '19 06:06 essen

I've worked around it for now; I'll look at a test case later this week if I get a chance. Otherwise, file it under "lol", I guess. I've posted something to the mailing list about the ambiguity.

rlipscombe avatar Jun 25 '19 10:06 rlipscombe

I feel your pain. Let's hope we'll get a good response from OTP team.

essen avatar Jun 25 '19 11:06 essen

OTP didn't reply.

Removing the bad module names is OK but it should be done at Ms = cover:imported_modules(), so that Ms does not contain them at all. We probably should issue a warning when some modules have been removed.

A test case is needed.

Today's not the day though.

essen avatar Jan 03 '20 09:01 essen

Low priority. For anyone else experiencing the problem, I exclude the entire app:

# top level Makefile
EXCLUDE_COVER_APPS_DIRS ?= $(APPS_DIR)/coverage

# in coverage-report.mk, included from top.mk
coverage-report:: $(if $(IS_APP),,apps-coverage-report)
 
ifneq ($(ALL_APPS_DIRS),)
COVER_REPORT_APPS_DIRS := $(filter-out $(EXCLUDE_COVER_APPS_DIRS),$(ALL_APPS_DIRS))

apps-coverage-report:
      $(verbose) set -e; for app in $(COVER_REPORT_APPS_DIRS); do $(MAKE) -C $$app cover-report IS_APP=1; done
endif

rlipscombe avatar Jan 03 '20 09:01 rlipscombe