The hpc-coveralls package

[Tags:bsd3, library, program]

This utility converts and sends Haskell projects hpc code coverage to coverall.io.

Usage

Commands to add to your project .travis.yml when using Travis CI:

 before_install:
   - cabal install hpc-coveralls
 script:
   - cabal configure --enable-tests --enable-library-coverage && cabal build
   - run-cabal-test [options] [cabal-test-options]
 after_script:
   - hpc-coveralls [options] [test-suite-name]

Further information can be found in the README.


[Skip to Readme]

Properties

Versions 0.1.0, 0.1.2, 0.2.0, 0.2.1, 0.2.2, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.9.0, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4
Change log CHANGELOG.md
Dependencies aeson, base (<5), bytestring (>=0.10), cmdargs (>=0.10), curl (>=1.3.8), hpc (>=0.6.0.0), process, regex-posix, split [details]
License BSD3
Copyright (c) 2014 Guillaume Nargeot
Author Guillaume Nargeot
Maintainer Guillaume Nargeot <guillaume+hackage@nargeot.com>
Stability experimental
Category Control
Home page https://github.com/guillaume-nargeot/hpc-coveralls/issues
Bug tracker https://github.com/guillaume-nargeot/hpc-coveralls
Source repository head: git clone https://github.com/guillaume-nargeot/hpc-coveralls.git
Uploaded Mon Apr 14 23:56:48 UTC 2014 by killy971
Distributions LTSHaskell:1.0.4, NixOS:1.0.4, Stackage:1.0.4
Downloads 7629 total (42 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Successful builds reported [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for hpc-coveralls

Readme for hpc-coveralls-0.2.1

hpc-coveralls Build Status

hpc-coveralls converts and sends Haskell projects hpc code coverage to coverall.io.

At the moment, only Travis CI has been tested, but hpc-coveralls should be compatible with other CI services (Check HpcCoverallsMain source for the list).

hpc-coveralls is still under development and any contributions are welcome!

Usage

Travis CI

Commands to add to your project .travis.yml:

before_install:
  - cabal install hpc-coveralls
script:
  - cabal configure --enable-tests --enable-library-coverage && cabal build
  - run-cabal-test [options] [cabal-test-options]
after_script:
  - hpc-coveralls [options] [test-suite-name]

Note that the usual cabal test command is replaced by run-cabal-test. The reason for this is explained in the next section.

For an example usage, please refer to this-project .travis.yml file (result on coveralls).

The run-cabal-test command

When using hpc 0.6, cabal test outputs an error message and exits with the error code 1, which results in a build failure.

In order to prevent this from happening, hpc-coveralls provides the run-cabal-test command which runs cabal test and returns with 0 if the regex ^Test suite .*: FAIL$ never matches any line of the output.

This hpc issue should be fixed in version 0.7 (not yet available on Travis CI).

Options

The --cabal-name option can be used to specify a custom executable name instead of the default cabal when calling cabal test.<br/> Below is an example which can be useful for projects with a Travis configuration based on multi-ghc-travis:

run-cabal-test --cabal-name=cabal-1.18

The hpc-coveralls command

At the moment, you can specify only one suite. For example, if your test suite is named test-all, use the command as follows:

hpc-coveralls test-all

Options

The --exclude-dir option can be used to exclude source files located under a given directory from the coverage report.<br/> You can exclude source files located under the test/ by using this option as in the following example:

hpc-coveralls --exclude-dir=test [test-suite-name]

Limitations

As Coveralls doesn't support yet partial-line coverage, the following convention is used to represent line coverage with line hit counts:

  • 0 : the line is never hit,
  • 1 : the line is partially covered,
  • 2 : the line is fully covered.

This convention is the same as the one used by cloverage coveralls output for Clojure projects code coverage.

There's an open issue to improve this.

Contributing

hpc-coveralls is still under development and any contributions are welcome!

Future Plans and Ideas

License

BSD3 (tl;dr)

Notes