Safe Haskell | None |
---|---|
Language | Haskell2010 |
Test.Syd.OptParse
Synopsis
- getSettings :: IO Settings
- data Settings = Settings {
- settingSeed :: !SeedSetting
- settingRandomiseExecutionOrder :: !Bool
- settingThreads :: !Threads
- settingMaxSuccess :: !Int
- settingMaxSize :: !Int
- settingMaxDiscard :: !Int
- settingMaxShrinks :: !Int
- settingGoldenStart :: !Bool
- settingGoldenReset :: !Bool
- settingColour :: !(Maybe Bool)
- settingFilter :: !(Maybe Text)
- settingFailFast :: !Bool
- settingIterations :: Iterations
- settingFailOnFlaky :: !Bool
- settingReportProgress :: !ReportProgress
- settingDebug :: !Bool
- defaultSettings :: Settings
- deriveTerminalCapababilities :: Settings -> IO TerminalCapabilities
- detectTerminalCapabilities :: IO TerminalCapabilities
- data Threads
- data Iterations
- data ReportProgress
- combineToSettings :: Flags -> Environment -> Maybe Configuration -> IO Settings
- data Configuration = Configuration {
- configSeed :: !(Maybe SeedSetting)
- configRandomiseExecutionOrder :: !(Maybe Bool)
- configThreads :: !(Maybe Threads)
- configMaxSize :: !(Maybe Int)
- configMaxSuccess :: !(Maybe Int)
- configMaxDiscard :: !(Maybe Int)
- configMaxShrinks :: !(Maybe Int)
- configGoldenStart :: !(Maybe Bool)
- configGoldenReset :: !(Maybe Bool)
- configColour :: !(Maybe Bool)
- configFilter :: !(Maybe Text)
- configFailFast :: !(Maybe Bool)
- configIterations :: !(Maybe Iterations)
- configFailOnFlaky :: !(Maybe Bool)
- configReportProgress :: !(Maybe Bool)
- configDebug :: !(Maybe Bool)
- getConfiguration :: Flags -> Environment -> IO (Maybe Configuration)
- defaultConfigFile :: IO (Path Abs File)
- data Environment = Environment {
- envConfigFile :: Maybe FilePath
- envSeed :: !(Maybe SeedSetting)
- envRandomiseExecutionOrder :: !(Maybe Bool)
- envThreads :: !(Maybe Threads)
- envMaxSize :: !(Maybe Int)
- envMaxSuccess :: !(Maybe Int)
- envMaxDiscard :: !(Maybe Int)
- envMaxShrinks :: !(Maybe Int)
- envGoldenStart :: !(Maybe Bool)
- envGoldenReset :: !(Maybe Bool)
- envColour :: !(Maybe Bool)
- envFilter :: !(Maybe Text)
- envFailFast :: !(Maybe Bool)
- envIterations :: !(Maybe Iterations)
- envFailOnFlaky :: !(Maybe Bool)
- envReportProgress :: !(Maybe Bool)
- envDebug :: !(Maybe Bool)
- defaultEnvironment :: Environment
- getEnvironment :: IO Environment
- environmentParser :: Parser Error Environment
- seedSettingEnvironmentParser :: Parser Error (Maybe SeedSetting)
- getFlags :: IO Flags
- prefs_ :: ParserPrefs
- flagsParser :: ParserInfo Flags
- data Flags = Flags {
- flagConfigFile :: !(Maybe FilePath)
- flagSeed :: !(Maybe SeedSetting)
- flagRandomiseExecutionOrder :: !(Maybe Bool)
- flagThreads :: !(Maybe Threads)
- flagMaxSize :: !(Maybe Int)
- flagMaxSuccess :: !(Maybe Int)
- flagMaxDiscard :: !(Maybe Int)
- flagMaxShrinks :: !(Maybe Int)
- flagGoldenStart :: !(Maybe Bool)
- flagGoldenReset :: !(Maybe Bool)
- flagColour :: !(Maybe Bool)
- flagFilter :: !(Maybe Text)
- flagFailFast :: !(Maybe Bool)
- flagIterations :: !(Maybe Iterations)
- flagFailOnFlaky :: !(Maybe Bool)
- flagReportProgress :: !(Maybe Bool)
- flagDebug :: !(Maybe Bool)
- defaultFlags :: Flags
- parseFlags :: Parser Flags
- seedSettingFlags :: Parser (Maybe SeedSetting)
- doubleSwitch :: [String] -> Mod FlagFields (Maybe Bool) -> Parser (Maybe Bool)
Documentation
getSettings :: IO Settings Source #
Test suite definition and run settings
Constructors
Settings | |
Fields
|
Instances
Constructors
Synchronous | One thread |
ByCapabilities | As many threads as |
Asynchronous !Word | A given number of threads |
Instances
Eq Threads Source # | |
Read Threads Source # | |
Show Threads Source # | |
Generic Threads Source # | |
HasCodec Threads Source # | |
Defined in Test.Syd.OptParse | |
type Rep Threads Source # | |
Defined in Test.Syd.OptParse type Rep Threads = D1 ('MetaData "Threads" "Test.Syd.OptParse" "sydtest-0.10.0.0-3hbJHNppGEOJTpttnKeKQH" 'False) (C1 ('MetaCons "Synchronous" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ByCapabilities" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Asynchronous" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word)))) |
data Iterations Source #
Constructors
OneIteration | Run the test suite once, the default |
Iterations !Word | Run the test suite for the given number of iterations, or until we can find flakiness |
Continuous | Run the test suite over and over, until we can find some flakiness |
Instances
data ReportProgress Source #
Constructors
ReportNoProgress | Don't report any progress, the default |
ReportProgress | Report progress |
Instances
Eq ReportProgress Source # | |
Defined in Test.Syd.OptParse Methods (==) :: ReportProgress -> ReportProgress -> Bool # (/=) :: ReportProgress -> ReportProgress -> Bool # | |
Read ReportProgress Source # | |
Defined in Test.Syd.OptParse Methods readsPrec :: Int -> ReadS ReportProgress # readList :: ReadS [ReportProgress] # | |
Show ReportProgress Source # | |
Defined in Test.Syd.OptParse Methods showsPrec :: Int -> ReportProgress -> ShowS # show :: ReportProgress -> String # showList :: [ReportProgress] -> ShowS # | |
Generic ReportProgress Source # | |
Defined in Test.Syd.OptParse Associated Types type Rep ReportProgress :: Type -> Type # Methods from :: ReportProgress -> Rep ReportProgress x # to :: Rep ReportProgress x -> ReportProgress # | |
type Rep ReportProgress Source # | |
Defined in Test.Syd.OptParse |
combineToSettings :: Flags -> Environment -> Maybe Configuration -> IO Settings Source #
Combine everything to Settings
data Configuration Source #
What we find in the configuration variable.
Do nothing clever here, just represent the configuration file. For example, use 'Maybe FilePath', not 'Path Abs File'.
Use readYamlConfigFile
or readFirstYamlConfigFile
to read a configuration.
Constructors
Configuration | |
Fields
|
Instances
getConfiguration :: Flags -> Environment -> IO (Maybe Configuration) Source #
Get the configuration
We use the flags and environment because they can contain information to override where to look for the configuration files.
We return a Maybe
because there may not be a configuration file.
data Environment Source #
What we find in the configuration variable.
Do nothing clever here, just represent the relevant parts of the environment.
For example, use Text
, not SqliteConfig
.
Constructors
Environment | |
Fields
|
Instances
environmentParser :: Parser Error Environment Source #
The envparse
parser for the Environment
prefs_ :: ParserPrefs Source #
The 'optparse-applicative' parsing preferences
flagsParser :: ParserInfo Flags Source #
The optparse-applicative
parser for Flags
The flags that are common across commands.
Constructors
Flags | |
Fields
|
Instances
defaultFlags :: Flags Source #