Ticket #955 (new defect)

Opened 13 months ago

Incorrect hpcdir during cabal test for testsuites w/ library coverage enabled

Reported by: albertfong Owned by:
Priority: normal Milestone:
Component: Cabal library Version: 1.14.0
Severity: normal Keywords:
Cc: Difficulty: unknown
GHC Version: 7.4.1 Platform: Windows

Description

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.

Attachments

Simple.zip Download (3.9 KB) - added by albertfong 13 months ago.

Change History

Changed 13 months ago by albertfong

Note: See TracTickets for help on using tickets.