https://github.com/brandonchinn178/hpc-lcov
Convert HPC coverage output to LCOV format
https://github.com/brandonchinn178/hpc-lcov
codecov coverage haskell test
Last synced: about 1 month ago
JSON representation
Convert HPC coverage output to LCOV format
- Host: GitHub
- URL: https://github.com/brandonchinn178/hpc-lcov
- Owner: brandonchinn178
- License: bsd-3-clause
- Created: 2020-02-13T00:45:03.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-21T01:03:12.000Z (4 months ago)
- Last Synced: 2025-03-20T06:05:11.656Z (about 1 month ago)
- Topics: codecov, coverage, haskell, test
- Language: Haskell
- Homepage: http://hackage.haskell.org/package/hpc-lcov
- Size: 131 KB
- Stars: 6
- Watchers: 7
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# hpc-lcov
[](https://github.com/brandonchinn178/hpc-lcov/actions?query=branch%3Amain)
[](https://codecov.io/gh/brandonchinn178/hpc-lcov)
[](https://hackage.haskell.org/package/hpc-lcov)Convert HPC output into `lcov.info` files that can be uploaded to coverage
services, like [Codecov](https://codecov.io).## Quickstart
1. Download `hpc-lcov` from the releases page or install it from Hackage with your favorite package manager
1. Run your tests with coverage enabled
* `stack test --coverage`
* Cabal is not yet supported (https://github.com/brandonchinn178/hpc-lcov/issues/3)
1. Run `hpc-lcov`
1. Upload the generated `lcov.info` file to your coverage service## FAQs
### How do I convert coverage for an executable?
Note: If you have both tests and executables, HPC will write module information to the same file. Because of this, you'll have to load the coverage for each separately, with a `stack clean` in between.
1. Build a single executable with coverage enabled (e.g. `stack build :my-exe --coverage`)
1. Run the executable
1. This should generate a `.tix` file in the current directory
1. Run the following, specifying the package that builds the executable:
```bash
stack exec -- hpc-lcov --file my-exe.tix --main-package my-package
```### How do I merge coverage files?
1. Install LCOV (e.g. `brew install lcov`)
1. Run```bash
lcov -a lcov1.info -a lcov2.info ... > lcov.info
```## Resources
* [LCOV format description](http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php)
* [More info on HPC](https://wiki.haskell.org/Haskell_program_coverage)