mirror of
https://github.com/barrucadu/dejafu.git
synced 2024-11-05 06:45:08 +03:00
Reduce default number of quickcheck tests in dejafu-tests
This commit is contained in:
parent
455a0f4ba7
commit
4791333dc0
@ -1,15 +1,30 @@
|
||||
module Main where
|
||||
|
||||
import Test.Framework (Test, defaultMain, testGroup)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import System.Environment (getArgs)
|
||||
import qualified Test.Framework as T
|
||||
|
||||
import Cases
|
||||
import Examples
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain allTests
|
||||
main = do
|
||||
opts <- setDefaults <$> (T.interpretArgsOrExit =<< getArgs)
|
||||
T.defaultMainWithOpts allTests opts
|
||||
|
||||
allTests :: [Test]
|
||||
allTests = map (uncurry testGroup)
|
||||
allTests :: [T.Test]
|
||||
allTests = map (uncurry T.testGroup)
|
||||
[ ("Test Cases", testCases)
|
||||
, ("Examples", testExamples)
|
||||
]
|
||||
|
||||
-- | Reduce the default number of quickcheck runs.
|
||||
setDefaults :: T.RunnerOptions -> T.RunnerOptions
|
||||
setDefaults opts = opts { T.ropt_test_options = set (T.ropt_test_options opts) } where
|
||||
set (Just opts) = Just (set' opts)
|
||||
set Nothing = Just (set' (T.TestOptions Nothing Nothing Nothing Nothing Nothing Nothing))
|
||||
|
||||
set' opts = opts
|
||||
{ T.topt_maximum_generated_tests = Just . fromMaybe 25 $
|
||||
T.topt_maximum_generated_tests opts
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user