File: Tasty.hs

package info (click to toggle)
haskell-vector 0.13.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,120 kB
  • sloc: haskell: 12,642; ansic: 6; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 723 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-- |
-- Tasty integration for vector benchmarks.
module Bench.Vector.Tasty
  ( VectorSize(..)
  , RandomSeed(..)
  ) where

import Test.Tasty.Options


-- | Size of vector used in benchmarks
newtype VectorSize = VectorSize Int

instance IsOption VectorSize where
  defaultValue = VectorSize 2000000
  parseValue = fmap VectorSize . safeRead
  optionName = pure "size"
  optionHelp = pure "Size of vectors used in benchmarks"

-- | Random seed used for generation of the test data
newtype RandomSeed = RandomSeed Int

instance IsOption RandomSeed where
  defaultValue = RandomSeed 42
  parseValue = fmap RandomSeed . safeRead
  optionName = pure "seed"
  optionHelp = pure "Random seed used for generation of the test data"