Skip to content

cabal new-test doesn't work with library-coverage for components with other-modules #5213

Closed
@RyanGlScott

Description

@RyanGlScott
$ cabal --version
cabal-install version 2.0.0.0
compiled using version 2.0.1.0 of the Cabal library

I'll work on preparing a minimal example in a bit. In the meantime, you can trigger this issue with scotty-0.11.0:

$ cabal get scotty-0.11.0
Unpacking to scotty-0.11.0/
$ cd scotty-0.11.0/
$ cat > cabal.project << EOF
> packages: .
> package scotty
>   library-coverage: true
> EOF
$ cabal new-test
Resolving dependencies...
In order, the following will be built (use -v for more details):
 - scotty-0.11.0 (lib) (first run)
 - scotty-0.11.0 (test:spec) (first run)
Configuring library for scotty-0.11.0..
Preprocessing library for scotty-0.11.0..
Building library for scotty-0.11.0..
<build output elided>
Configuring test suite 'spec' for scotty-0.11.0..
Preprocessing test suite 'spec' for scotty-0.11.0..
Building test suite 'spec' for scotty-0.11.0..
<build output elided>
Running 1 test suites...
Test suite spec: RUNNING...
<test output elided>
Test suite spec: PASS
Test suite logged to:
/home/ryanglscott/Documents/Hacking/Haskell/scotty-0.11.0/dist-newstyle/build/x86_64-linux/ghc-8.2.2/scotty-0.11.0/c/spec/test/scotty-0.11.0-spec.log
hpc: can not find scotty-0.11.0-inplace/Web.Scotty.Util in ./.hpc, /home/ryanglscott/Documents/Hacking/Haskell/scotty-0.11.0/dist-newstyle/build/x86_64-linux/ghc-8.2.2/scotty-0.11.0/c/spec/hpc/vanilla/mix/scotty-0.11.0, /home/ryanglscott/Documents/Hacking/Haskell/scotty-0.11.0/dist-newstyle/build/x86_64-linux/ghc-8.2.2/scotty-0.11.0/c/spec/hpc/vanilla/mix/spec
CallStack (from HasCallStack):
  error, called at libraries/hpc/Trace/Hpc/Mix.hs:122:15 in hpc-0.6.0.3:Trace.Hpc.Mix
cabal: Tests failed for test:spec from scotty-0.11.0.

This error doesn't happen for another project, wai-middleware-static-0.8.1. Unlike scotty, wai-middleware-static has no other-modules, so I suspect that is the culprit here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions