[Haskell-cafe] Organizaing tests in Haskell

Heinrich Apfelmus apfelmus at quantentunnel.de
Mon Sep 24 15:46:55 CEST 2012


Simon Hengel wrote:
> On Sun, Sep 23, 2012 at 06:11:59PM +0200, Heinrich Apfelmus wrote:
>>
>> 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
> 
> or
> 
>   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.

I got it to work, thanks!

I also had to duplicate the dependency information, but that's alright.


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com




More information about the Haskell-Cafe mailing list