killy971 / codecov-haskell

codecov.io support for haskell code coverage with hpc
http://hackage.haskell.org/package/codecov-haskell
BSD 3-Clause "New" or "Revised" License
29 stars 16 forks source link

Adding commandline arguments to allow setting mix and tix paths. #12

Closed jonathankochems closed 7 years ago

jonathankochems commented 7 years ago

Hi, This change adds commandline arguments so that it is possible to set provide the paths of directories containing mix and tix files. This is useful for integration with stack test --coverage which places them into two directories under: .stack-work/install/../../../hpc/ and .stack-work/dist/../Cabal-../hpc.

With this pull request's change it is possible to run:

codecov-haskell [options] --tix-dir=$(stack path --local-hpc-root)/<pkgname>/ --mix-dir=$(stack path --dist-dir)/hpc/ [test-suite-names]

which picks up the the right locations from a stack build.

jonathankochems commented 7 years ago

The ghc-7.6.3 build fails with the message below which is unlikely to be caused by my changes. It's not clear to me what an immediate fix would be...

...
Downloading aeson-1.2.0.0...
Configuring aeson-1.2.0.0...
Building aeson-1.2.0.0...
Installed aeson-1.2.0.0
cabal-1.20: Error: some packages failed to install:
cmdargs-0.10.17 failed during the configure step. The exception was:
user error (The package 'cmdargs' requires Cabal library version -any &&
>=1.18 but no suitable version is installed.)
safe-0.3.14 failed during the configure step. The exception was:
user error (The package 'safe' requires Cabal library version -any && >=1.18
but no suitable version is installed.)
The command "cabal-1.20 install --only-dependencies --enable-tests --enable-benchmarks" failed and exited with 1 during .
Your build has been stopped.
killy971 commented 7 years ago

Thank you for the contribution. Please give me a little time to review. Regarding the failures with version 7.6.3 I'm not sure what to do yet, but and I have little understanding of what percentage of projects still use this version. I guess supporting more recent versions is more important.

jonathankochems commented 7 years ago

Sure thing and thanks for reviewing. Feel free to reach out with any comments or suggestions. I'm very interested to have codecov-haskell working with stack builds as I use codecov for my haskell projects.

jonathankochems commented 7 years ago

Hi @guillaume-nargeot, Have you had a chance to review the pull request, yet? It would be nice to be able to use a codecov-haskell release version with stack projects. Thanks!