Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rlipscombe opened this issue Jun 24, 2019 · 5 comments
Open

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

rlipscombe opened this issue Jun 24, 2019 · 5 comments

Comments

@rlipscombe
Copy link
Contributor

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?

@essen
Copy link
Member

essen commented Jun 25, 2019

lol

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

@rlipscombe rlipscombe changed the title coverage-report fails if you have a module named 'coverage' cover-report fails if you have a module named 'coverage' Jun 25, 2019
@rlipscombe
Copy link
Contributor Author

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.

@essen
Copy link
Member

essen commented Jun 25, 2019

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

@essen
Copy link
Member

essen commented Jan 3, 2020

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.

@rlipscombe
Copy link
Contributor Author

rlipscombe commented Jan 3, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants