killy971 / hpc-coveralls

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

Find tix files for non-Main modules #5

Closed maoe closed 10 years ago

maoe commented 10 years ago

I found a case where hpc-coveralls couldn't find a tix file: https://travis-ci.org/maoe/influxdb-haskell/jobs/22322723#L985

HPC sometimes puts a package ID prefix. In my case, the tix file for test-suite is something like:

Tix [ TixModule "influxdb-0.0.0/Database.InfluxDB.Types" 2843817 ...

and dist/hpc directory looks like:

dist/hpc/mix/influxdb-0.0.0/influxdb-0.0.0/Database.InfluxDB.Decode.mix
dist/hpc/mix/influxdb-0.0.0/influxdb-0.0.0/Database.InfluxDB.Encode.mix
dist/hpc/mix/influxdb-0.0.0/influxdb-0.0.0/Database.InfluxDB.Http.mix
dist/hpc/mix/influxdb-0.0.0/influxdb-0.0.0/Database.InfluxDB.Lens.mix
dist/hpc/mix/influxdb-0.0.0/influxdb-0.0.0/Database.InfluxDB.mix
dist/hpc/mix/influxdb-0.0.0/influxdb-0.0.0/Database.InfluxDB.Stream.mix
dist/hpc/mix/influxdb-0.0.0/influxdb-0.0.0/Database.InfluxDB.Types.Internal.mix
dist/hpc/mix/influxdb-0.0.0/influxdb-0.0.0/Database.InfluxDB.Types.mix
dist/hpc/mix/test-suite/Main.mix
dist/hpc/tix/test-suite/test-suite.tix

I've tested the patch locally with 7.6.3 and 7.4.2, but haven't actually tried it on Travis-CI and Coveralls. It would be appreciated if you also could test it.

killy971 commented 10 years ago

Thank you very much for your patch. I'm going to test how it goes with Coveralls

killy971 commented 10 years ago

I've just tested your change, and it works fine. I'm going to merge it, and it will be included in v0.2.0 release (I don't know yet when it will be released) with other improvements.

If you ever want to use hpc-coveralls HEAD version from now, you can replace the following before_install instruction in your .travis.yml configuration file:

  - cabal install hpc-coveralls

by:

  - git clone https://github.com/guillaume-nargeot/hpc-coveralls.git
  - cd hpc-coveralls
  - cabal install
  - cd ..

It is not guaranteed to be stable, but I'm doing my best to keep it stable.

maoe commented 10 years ago

Thanks!

killy971 commented 10 years ago

I've released your change to Hackage as version 0.1.2, after a few hiccups with branching/merging/tagging (I'm quite new to git workflow...). You can now use it again with the following command in your travis config: - cabal install hpc-coveralls or - cabal install hpc-coveralls-0.1.2

Please tell me if you still have problems

maoe commented 10 years ago

Great. That worked.