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 include modules non-referenced from tests in the code coverage report #28

Open
killy971 opened this issue Sep 19, 2014 · 3 comments

Comments

@killy971
Copy link
Owner

Because of the way hpc works, the coverage data generated only covers the modules which were referenced directly (or transitively?) by the test suites that are run.

Because of this, modules which are not referenced because of lack of test are not considered into the total coverage calculation.

This problem can be solved by introducing a new command line option to specify the source folders.
Then, hpc-coveralls will automatically include all the source files from the source tree, and the ones that are not included in the tix/mix data will be considered as not covered.

@killy971
Copy link
Owner Author

Implementing this may not be as simple as it seems, as we have to differentiate the lines that are Haskell code and the lines that are not (which would count in the coverage).

It may be a good idea to check how hpc works and see if something can be reused for this purpose.

Another way is to use a Haskell code parser (which one?).
It is then a matter of using the same rules as hpc in order to determine which lines should be considered as "coverable" code.

@killy971
Copy link
Owner Author

Haskell code parser libraries: haskell-src-exts, ghc-parser

@ghost
Copy link

ghost commented Jul 20, 2018

You can also publish a tip in readme on how to change test suite/application to trick hpc into including all source. See Databrary for an example.

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

No branches or pull requests

1 participant