[Haskell-cafe] Using Cabal during development

Rahul Kapoor rk at trie.org
Tue Feb 9 13:44:44 EST 2010

> Okay, but have you ever felt the need to make in the same project a library
> and an executable which depends on this library (even just like me, for
> testing purpose)? How would you do it?

Specifying the modules under test in other-modules section for the executable
does the trick for me. I can email you a suitable elided cabal file
for one of my projects
if you want.

Also another really helpful thing for testing is adding a .ghci file
in your project
I usually check in the .ghci with my source. Standard commands that I define
in .ghci usually include :test to run the Test Suite. I also use .ghci
set up the correct
source paths and to start up with the test module loaded. So
recompiles are usually
just as simple as :reload.

I still run the complete "cabal configure -ftest && cabal configure
build && ./dist/..../test
before commits.


More information about the Haskell-Cafe mailing list