paramtree: Generate labelled test/benchmark trees from sets of parameters

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Easily generate a labelled tree of tests/benchmarks from a generation function and sets of parameters to use for each of that functions arguments. Example usecases include criterion benchmark trees or tasty test trees.


[Skip to ReadMe]

Properties

Versions0.1.0, 0.1.0, 0.1.1, 0.1.1.1
Change logNone available
Dependenciesbase (>=4.6 && <5), containers (>=0.4 && <0.6) [details]
LicenseBSD-3-Clause
CopyrightCopyright © 2017 Merijn Verstraaten
AuthorMerijn Verstraaten
MaintainerMerijn Verstraaten <merijn@inconsistent.nl>
CategoryDevelopment, Benchmarking, Testing
Home pagehttps://github.com/merijn/paramtree
Bug trackerhttps://github.com/merijn/paramtree/issues
Source repositoryhead: git clone ssh://github.com:merijn/paramtree.git
head: hg clone https://bitbucket.org/merijnv/paramtree
UploadedSat Nov 4 23:33:39 UTC 2017 by MerijnVerstraaten

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for paramtree-0.1.0

[back to package description]

ParamTree

BSD3 Hackage Build Status

ParamTree library for generating labelled test/benchmark trees from sets of parameters. Example usecases include criterion benchmark trees or tasty test trees.

Example

import Test.Tasty
import Test.Tasty.HUnit

genTestCase :: Int -> Bool -> Char -> String -> TestTree
genTestCase i b c name = testCase name $ {- your code here -}

params = 'simpleParam' \"Int\" [1,2]
       . 'simpleParam' \"Bool\" [True]
       . 'simpleParam' \"Char\" "xyz"

main :: IO ()
main = defaultMain $ testTree genTestCase params
  where
    testTree = growTree (Just "/") testGroup "my tests"

This generates a tasty TestTree with all combinations of values passed to genTestCase. If the Maybe String argument is provided like in the above example, groups with a single entry, such as "Bool" get collapsed into their parent groups. So instead of a "1 Int" group containing a "True Bool" group they get collapsed into a single "1 Int/True Bool" group, where the "/" separator is the one specified by Just "/".