Skip to content

Code coverage requires all derived methods to be tested

Summary

Running "stack --coverage test" yields incorrect results.

Steps to reproduce

Untar coverage-bug.tbz2 and run "stack --coverage test". Then look at the generated HTML page for Lib.hs (Lib.hs.html). It shows zero coverage for Ord even though it was clearly tested.

coverage-bug.tbz2

Expected behavior

Correct coverage numbers.

Environment

I tried it with everything listed on https://www.stackage.org/.

  • Nightly 2019-09-04
  • LTS 14.4 for ghc-8.6.5
  • LTS 13.19 for ghc-8.6.4
  • LTS 13.11 for ghc-8.6.3
  • LTS 12.26 for ghc-8.4.4
  • LTS 12.14 for ghc-8.4.3
  • LTS 11.22 for ghc-8.2.2
  • LTS 9.21 for ghc-8.0.2
  • LTS 7.24 for ghc-8.0.1
  • LTS 6.35 for ghc-7.10.3
  • LTS 3.22 for ghc-7.10.2

Optional:

  • Operating System: Gentoo
  • System Architecture: x86_64
Edited by Matthew Pickering
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information