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

Add option to exclude individual files #4

Closed
scottclowe opened this issue Feb 2, 2016 · 2 comments
Closed

Add option to exclude individual files #4

scottclowe opened this issue Feb 2, 2016 · 2 comments

Comments

@scottclowe
Copy link
Contributor

I would like to test the coverage over a (recursive) folder, but exclude individual files within the folder(s).

This would be a useful feature generally if you have .m files which don't need to be in the coverage report but which should be in the folder with the rest of the package contents.

However, in my use-case I specifically want to exclude a file which is used to determine the path to the package (for the purpose of loading resource files within the package). This file needs to be excluded because the path will be incorrect if it is moved to a temporary directory for coverage calculation purposes.

@nno
Copy link
Contributor

nno commented Feb 2, 2016

Probably the easiest way to achieve this is:

  • update mocov_find_files.m to support an exclusion option, for example as a fourth argument. This could be a cell with filenames and/or wildecard patterns.
  • add an option to mocov.m which specifies a file (possibly pattern) to be excluded. Even better if multiple exclusion options can be specified.
  • the excluded files are passed to the MOcovMFileCollection/MOcovMFileColleciton.m constructor and stored internally
  • In MOcovMFileCollection/prepare.m, pass the excluded files to mocov_find_files.m

Do you think this will address your use-case?

@scottclowe
Copy link
Contributor Author

Yes, this sounds like it would be a good solution for this issue and would work for me.

However for my particular use-case, closing #5 would let me check the coverage on the file in question instead of omitting it from the coverage dataset.

scottclowe added a commit to scottclowe/MOcov that referenced this issue Feb 22, 2016
This adds an option to the API to specify patterns which should not
be included in the coverage report.

Closes MOxUnit#4.
@nno nno closed this as completed in #6 Feb 26, 2016
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