[Hackage] #955: Incorrect hpcdir during cabal test for testsuites w/ library coverage enabled

Hackage cvs-ghc at haskell.org
Mon May 21 08:08:07 CEST 2012


#955: Incorrect hpcdir during cabal test for testsuites w/ library coverage
enabled
----------------------------+-----------------------------------------------
  Reporter:  albertfong     |        Owner:        
      Type:  defect         |       Status:  new   
  Priority:  normal         |    Milestone:        
 Component:  Cabal library  |      Version:  1.14.0
  Severity:  normal         |     Keywords:        
Difficulty:  unknown        |   Ghcversion:  7.4.1 
  Platform:  Windows        |  
----------------------------+-----------------------------------------------
 When running "cabal test" on a project configured with "cabal configure
 --enable-tests --enable-library-coverage", the hpcdir for test suites
 points to dist/hpc/mix/PackageName, not dist/hpc/mix/TestSuiteName.

 This results in an aborted run:
 {{{
 PS C:\Users\Albert Fong\Repositories\working\projects\Simple>
 runhaskell.exe .\Setup.hs test -v
 Running 3 test suites...
 Test suite Tests3: RUNNING...
 Test suite Tests3: PASS
 Test suite logged to: dist\test\Simple-0.1.0.0-Tests3.log
 C:\Users\Albert
 Fong\Repositories\working\devenv\tools\ghc-7.4.1\bin\hpc.exe markup
 dist\hpc\tix\Tests3\Tests3.tix --hpc
 dir=dist\hpc\mix\Simple-0.1.0.0 --destdir=dist\hpc\html\Tests3
 --exclude=Main
 hpc.exe: can not find Library in ["./dist\\hpc\\mix\\Simple-0.1.0.0"]
 PS C:\Users\Albert Fong\Repositories\working\projects\Simple>
 }}}

 Note the hpcdir during build ("-fhpc -hpcdir dist\hpc\mix\Tests3") is not
 what's used during test ("--hpcdir=dist\hpc\mix\Simple-0.1.0.0")

 {{{
 Preprocessing test suite 'Tests3' for Simple-0.1.0.0...
 Building test suite Tests3...
 creating dist\build\Tests3
 creating dist\build\Tests3\Tests3-tmp
 C:\Users\Albert
 Fong\Repositories\working\devenv\tools\ghc-7.4.1\bin\ghc.exe --make -o
 dist\build\Tests3\Tests3.exe -hid
 e-all-packages -fbuilding-cabal-package -no-user-package-conf -package-
 conf dist\package.conf.inplace -i -idist\build\Te
 sts3\Tests3-tmp -i. -idist\build\autogen -Idist\build\autogen
 -Idist\build\Tests3\Tests3-tmp -optP-include -optPdist\bui
 ld\autogen\cabal_macros.h -odir dist\build\Tests3\Tests3-tmp -hidir
 dist\build\Tests3\Tests3-tmp -stubdir dist\build\Tes
 ts3\Tests3-tmp -package-id base-4.5.0.0-597748f6f53a7442bcae283373264bb6
 -O -fhpc -hpcdir dist\hpc\mix\Tests3 -XHaskell9
 8 .\Tests.hs
 }}}

 Here's the layout of the dist/hpc folder:

 {{{
 dist\hpc\mix
 dist\hpc\mix\Simple-0.1.0.0
 dist\hpc\mix\Simple-0.1.0.0\Simple-0.1.0.0
 dist\hpc\mix\Simple-0.1.0.0\Simple-0.1.0.0\Library.mix
 dist\hpc\mix\Tests1
 dist\hpc\mix\Tests1\Library.mix
 dist\hpc\mix\Tests1\Main.mix
 dist\hpc\mix\Tests2
 dist\hpc\mix\Tests2\Library.mix
 dist\hpc\mix\Tests2\Main.mix
 dist\hpc\mix\Tests3
 dist\hpc\mix\Tests3\Library.mix
 dist\hpc\mix\Tests3\Main.mix
 dist\hpc\tix
 dist\hpc\tix\Tests3
 dist\hpc\tix\Tests3\Tests3.tix
 }}}

 The double nested "Simple-0.1.0.0" under mix may be another issue as well.

 A cabal project used to repro this issue is attached.

-- 
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/955>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects



More information about the cabal-devel mailing list