[GHC] #9619: HPC Code Coverage complains when two exactly the same mix files are on the path

GHC ghc-devs at haskell.org
Thu Mar 5 13:07:08 UTC 2015


#9619: HPC Code Coverage complains when two exactly the same mix files are on the
path
-------------------------------------+-------------------------------------
        Reporter:  Kasper            |                   Owner:
            Type:  bug               |                  Status:  infoneeded
        Priority:  lowest            |               Milestone:
       Component:  Code Coverage     |                 Version:  7.8.3
      Resolution:                    |                Keywords:
Operating System:  Linux             |            Architecture:  x86_64
 Type of failure:  Incorrect result  |  (amd64)
  at runtime                         |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by thomie):

 * status:  new => infoneeded


Comment:

 @Kasper: I need your help here. I can't reproduce your problem.

 Here's what I've tried. Source code:
 {{{
 cat > ./T9619.cabal <<EOF
 name:                T9619
 version:             0.1.0.0
 build-type:          Simple
 cabal-version:       >=1.2

 executable T9619
     main-is: T9619.hs
     build-depends: base

 test-suite IntegrationTests
     type: exitcode-stdio-1.0
     main-is: IntegrationTests.hs
     ghc-options: -main-is IntegrationTests
     other-modules: ModuleATest
     build-depends: base

 test-suite UnitTests
     type: exitcode-stdio-1.0
     main-is: UnitTests.hs
     ghc-options: -main-is UnitTests
     other-modules: ModuleATest
     build-depends: base
 EOF

 cat > ./Setup.hs <<EOF
 import Distribution.Simple
 main = defaultMain
 EOF

 cat > ./T9619.hs <<EOF
 main = return ()
 EOF

 cat > ./IntegrationTests.hs <<EOF
 module IntegrationTests(main) where
 import ModuleATest
 main :: IO ()
 main = print moduleATest
 EOF

 cat > ./UnitTests.hs <<EOF
 module UnitTests(main) where
 import ModuleATest
 main :: IO ()
 main = print moduleATest
 EOF

 cat > ./ModuleATest.hs <<EOF
 module ModuleATest where
 moduleATest = "hello"
 EOF
 }}}

 {{{
 $ cabal configure --enable-tests --enable-coverage
 $ cabal test

 $ find dist/hpc/vanilla/mix/ > output
 dist/hpc/vanilla/mix/
 dist/hpc/vanilla/mix/IntegrationTests
 dist/hpc/vanilla/mix/IntegrationTests/ModuleATest.mix
 dist/hpc/vanilla/mix/IntegrationTests/IntegrationTests.mix
 dist/hpc/vanilla/mix/UnitTests
 dist/hpc/vanilla/mix/UnitTests/ModuleATest.mix
 dist/hpc/vanilla/mix/UnitTests/UnitTests.mix

 $ hpc sum dist/hpc/vanilla/tix/IntegrationTests/IntegrationTests.tix
 dist/hpc/vanilla/tix/UnitTests/UnitTests.tix --union
 Tix [TixModule "IntegrationTests" 1693426709 3 [1,1,1],TixModule
 "ModuleATest" 897400108 2 [2,2],TixModule "UnitTests" 1821344755 3
 [1,1,1]]

 $ cabal --version
 cabal-install version 1.23.0.0
 using version 1.23.0.0 of the Cabal library

 $ ghc --version
 The Glorious Glasgow Haskell Compilation System, version 7.8.4
 }}}

 It all seems to work to me. The `ModuleATest.mix` file is indeed generated
 twice, but it doesn't seem to bother `hpc sum`.

 You mention "When performing hpc sum and hpc markup to get the total
 result of the test runs I need to specify the directories where the mix
 files are present". What is the command you use to run `hpc sum`. My
 understanding is that `hpc sum` only takes .tix files, not .mix files.

 I must be missing something, so please clarify.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9619#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list