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

[ benchmarking, bsd3, development, library, testing ] [ Propose Tags ]

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]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.1.1, 0.1.1.1, 0.1.2 (info)
Dependencies base (>=4.6 && <5), containers (>=0.4 && <0.7) [details]
License BSD-3-Clause
Copyright Copyright © 2017-2020 Merijn Verstraaten
Author Merijn Verstraaten
Maintainer Merijn Verstraaten <merijn@inconsistent.nl>
Revised Revision 3 made by MerijnVerstraaten at 2020-10-29T16:04:03Z
Category Development, Benchmarking, Testing
Home page https://github.com/merijn/paramtree
Bug tracker https://github.com/merijn/paramtree/issues
Source repo head: git clone ssh://github.com:merijn/paramtree.git
Uploaded by MerijnVerstraaten at 2018-09-19T11:42:35Z
Distributions NixOS:0.1.2
Reverse Dependencies 1 direct, 1 indirect [details]
Downloads 2092 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for paramtree-0.1.1.1

[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 "/".