[Haskell-cafe] Organizaing tests in Haskell
sol at typeful.net
Sun Sep 23 19:00:51 CEST 2012
On Sun, Sep 23, 2012 at 06:11:59PM +0200, Heinrich Apfelmus wrote:
> Simon Hengel wrote:
> >>Of course others are still able to import your Internal modules
> >That is not necessarily true. For libraries, you can list internal
> >modules as other-modules (in contrast to exposed-modules) in you Cabal
> >file. That way they are not part of the public interface of your
> How do I access internal modules with cabal test , though? Last
> time I tried, I could not find a way to expose in the test section
> of the cabal file.
It works, if you add the source directory to hs-source-dirs of the test
suite (in contrast to depending on the library!), e.g.:
hs-source-dirs: test, src
hs-source-dirs: test, .
This still has the disadvantage, that the sources are compiled twice.
But I'm not aware of a better way to do it. If you mostly use GHCi for
development, it's not a big issue.
More information about the Haskell-Cafe