
Sean Leather wrote:
How do folks like to package up QuickCheck tests for their libraries? In the main library? As a separate repo & package? Same repo & separate package? Keeping tests with the tested code allows testing of non-exported functionality, but can add quite a lot of clutter.
I have QuickCheck properties plus HUnit tests, but I think the question is the same. For me, it's in the same repository and shipped with the package source. I think that if you ship source (even via Hackage), you should also ship tests. So, if somebody wants to modify the source, they can run the tests. And making it convenient to test is very important, so I have "cabal test" (or "runhaskell Setup.hs test" without cabal-install) configured to run the tests. I don't think tests should (in general) be part of the user-visible API, so I have them external to the module hierarchy.
Do you have a quick-and-easy recipe you could post for making this stuff work well? In particular, it would be helpful to have it not install the test program as well. I'm not as fluent in the intracacies of Cabal as I ought to be, I'm afraid. -- John