You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We have a main streamly package and a separate packages for tests streamly-tests. They are in the same repository and built using a cabal.project file. But with this, coverage with --enable-coverage fails.
Verbose option shows that hpc is called with --hpcdir corresponding to streamly-tests package but streamly library is not being used in --hpcdir arguments:
/nix/store/1nbxcb9g5ys0q0y8sfvsvd4gjb0jml81-ghc-8.8.3-with-packages/bin/hpc markup /home/harendra/composewell/streamly1/.packcheck/streamly-0.7.2/dist-newstyle/build/x86_64-linux/ghc-8.8.3/streamly-tests-0.0.0/hpc/vanilla/tix/Data.Array/Data.Array.tix '--destdir=/home/harendra/composewell/streamly1/.packcheck/streamly-0.7.2/dist-newstyle/build/x86_64-linux/ghc-8.8.3/streamly-tests-0.0.0/hpc/vanilla/html/Data.Array' '--hpcdir=/home/harendra/composewell/streamly1/.packcheck/streamly-0.7.2/dist-newstyle/build/x86_64-linux/ghc-8.8.3/streamly-tests-0.0.0/hpc/vanilla/mix/Data.Array' '--hpcdir=/home/harendra/composewell/streamly1/.packcheck/streamly-0.7.2/dist-newstyle/build/x86_64-linux/ghc-8.8.3/streamly-tests-0.0.0/hpc/vanilla/mix/streamly-tests-0.0.0' '--exclude=Main'
hpc: can not find streamly-0.7.2-inplace/Streamly.Internal.Data.Either.Strict in ./.hpc, /home/harendra/composewell/streamly1/.packcheck/streamly-0.7.2/dist-newstyle/build/x86_64-linux/ghc-8.8.3/streamly-tests-0.0.0/hpc/vanilla/mix/streamly-tests-0.0.0, /home/harendra/composewell/streamly1/.packcheck/streamly-0.7.2/dist-newstyle/build/x86_64-linux/ghc-8.8.3/streamly-tests-0.0.0/hpc/vanilla/mix/Data.Array
CallStack (from HasCallStack):
error, called at libraries/hpc/Trace/Hpc/Mix.hs:122:15 in hpc-0.6.0.3:Trace.Hpc.Mix
CallStack (from HasCallStack):
die', called at ./Distribution/Client/ProjectOrchestration.hs:1041:55 in main:Distribution.Client.ProjectOrchestration
cabal: Tests failed for streamly-tests-0.0.0-inplace.
We had to separate the tests because cabal does not allow an internal test library when the build type is configure. We need an internal test library because we have a lot of common code which would have to be built for each test-suite without a library, increasing build times enormously.
To Reproduce
Use a library package (./lib-package.cabal) and a test package (./test/test-package.cabal) in the same project, add them to cabal.project and:
$ cabal v2-test -v --enable-tests --enable-coverage all
Expected behavior
We should be able to use --enable-coverage when tests are separated from the main library.
System information
Linux
cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
The text was updated successfully, but these errors were encountered:
This is very likely the same issue as #5433 -- not an issue with test packages specifically, but instead with any package depending on another in the same project.
@harendra-kumar: it's quite likely this got fixed in #7250 and/or #7358, which are both merged. Could you perhaps check, e.g., using a dev releast that can be obtained as in #7458 (comment)
Describe the bug
We have a main
streamly
package and a separate packages for testsstreamly-tests
. They are in the same repository and built using acabal.project
file. But with this, coverage with--enable-coverage
fails.Verbose option shows that hpc is called with
--hpcdir
corresponding tostreamly-tests
package butstreamly
library is not being used in--hpcdir
arguments:We had to separate the tests because cabal does not allow an internal test library when the build type is
configure
. We need an internal test library because we have a lot of common code which would have to be built for each test-suite without a library, increasing build times enormously.To Reproduce
Use a library package (
./lib-package.cabal
) and a test package (./test/test-package.cabal
) in the same project, add them tocabal.project
and:Expected behavior
We should be able to use --enable-coverage when tests are separated from the main library.
System information
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 8.8.3
The text was updated successfully, but these errors were encountered: