[Haskell-cafe] Recipes for organizing HUnit tests
berlin.brown at gmail.com
Sun Oct 28 14:28:25 EDT 2007
Isaac Dupree wrote:
> Mushfeq Khan wrote:
>> I'm new to Haskell and am trying to find a good way to organize my HUnit
>> tests. Having used some of the other XUnit frameworks, I tended towards
>> trying to organize them all in a parallel "test" folder structure,
>> but this
>> seems to be a bad fit for Haskell, since the test modules cannot see the
>> source modules unless they are either in the same folder or a folder
>> it. That's without modifying the module search path when I run the
>> which I would like to avoid.
> Well, it's certainly possible to use parallel directory structures --
> this is one way to do it:
> module Xyzzy.Gizmo where
> module Test.Gizmo where
> import Xyzzy.Gizmo
> main = ...
> ghc --make -main-is Test.Gizmo.main Test/Gizmo.hs
> Or without -main-is,
> module Main where
> import Test.Gizmo
> import Test.Bar
> main = testGizmo, testBar ...
> ghc --make Tests
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
I asked the same question a while back. Yea, you want the parallel
directory structure and you use the "-iMyPack -iHUnit" option when
compiling you haskell code.
You can kind of see what I did with this project. I have HUnit source
in one module and Tests in a different module, different directory.
More information about the Haskell-Cafe