
On 06/29/12 03:58, Mateusz Neumann wrote:
On Fri, 29 Jun 2012 08:43:33 +0100 Lorenzo Bolla
wrote: Are the examples in the package distribution of any help? https://github.com/batterseapower/test-framework/blob/master/example/Test/Fr...
L.
I was thinking more about parametres set in Haskell code itself. There is something like TestOptions (http://hackage.haskell.org/packages/archive/test-framework/0.6/doc/html/Test...) and RunnerOptions (http://hackage.haskell.org/packages/archive/test-framework/0.6/doc/html/Test...) but I do not find any examples of using them. Similarly, I do not know how to set them up.
Here's an example main function that also uses test-framework-doctest. There's only one trick used: because TestOptions/RunnerOptions are instances of monoid, we can use "mempty" to get an empty set of options. This is a little more fun than creating an empty record by hand. main :: IO () main = do dt <- docTest ["src/Everything.hs"] ["-isrc"] let empty_test_opts = mempty :: TestOptions let my_test_opts = empty_test_opts { topt_maximum_generated_tests = Just 500 } let empty_runner_opts = mempty :: RunnerOptions let my_runner_opts = empty_runner_opts { ropt_test_options = Just my_test_opts } defaultMainWithOpts ([dt] ++ tests) my_runner_opts