1 {-# LANGUAGE DeriveDataTypeable #-}
3 module UnitTests
.Options
4 ( OptionShowSolverLog
(..)
5 , OptionMtimeChangeDelay
(..)
14 import Test
.Tasty
.Options
16 {-------------------------------------------------------------------------------
18 -------------------------------------------------------------------------------}
20 extraOptions
:: [OptionDescription
]
22 [ Option
(Proxy
:: Proxy OptionShowSolverLog
)
23 , Option
(Proxy
:: Proxy OptionMtimeChangeDelay
)
24 , Option
(Proxy
:: Proxy RunNetworkTests
)
27 newtype OptionShowSolverLog
= OptionShowSolverLog
Bool
30 instance IsOption OptionShowSolverLog
where
31 defaultValue
= OptionShowSolverLog
False
32 parseValue
= fmap OptionShowSolverLog
. safeReadBool
33 optionName
= return "show-solver-log"
34 optionHelp
= return "Show full log from the solver"
35 optionCLParser
= flagCLParser Nothing
(OptionShowSolverLog
True)
37 newtype OptionMtimeChangeDelay
= OptionMtimeChangeDelay
Int
40 instance IsOption OptionMtimeChangeDelay
where
41 defaultValue
= OptionMtimeChangeDelay
0
42 parseValue
= fmap OptionMtimeChangeDelay
. safeRead
43 optionName
= return "mtime-change-delay"
46 "How long to wait before attempting to detect"
47 ++ "file modification, in microseconds"
49 newtype RunNetworkTests
= RunNetworkTests
Bool
52 instance IsOption RunNetworkTests
where
53 defaultValue
= RunNetworkTests
True
54 parseValue
= fmap RunNetworkTests
. safeReadBool
55 optionName
= return "run-network-tests"
56 optionHelp
= return "Run tests that need network access (default true)."