[Haskell-cafe] Maintaining test-suite dependencies with cabal

Rogan Creswick creswick at gmail.com
Thu Sep 4 20:36:47 UTC 2014


On Fri, Aug 22, 2014 at 10:22 AM, Omari Norman <omari at smileystation.com>
wrote:
>
>
> But a tool like Cartel does nothing about compile times.  If compile times
> are really a concern, I would just put the library in a completely separate
> package and package the executables and tests separately.
>

One way to help reduce compile times (a bit anyway) is to separate the
executables and tests into parallel source directories from your library
code.  I generally use a layout like this:

<project dir>/
     - project.cabal
     - src/
     - apps/
     - tests/resources/
     - tests/src/

Library code goes in src, application Main's go in apps/, test source goes
in tests/src/ and any necessary data files go in tests/resources.

Then tests and apps defined in the cabal file depend on the library, and
the source for the library is not rebuilt for each executable/test
declaration in the cabal file (generally speaking; with flags and custom
builds you can cause just about anything...)

--Rogan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140904/ed684ba7/attachment.html>


More information about the Haskell-Cafe mailing list