aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src/Test/Haddock
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-08-17 12:54:48 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-08-22 23:40:27 +0200
commit5568091a53ee53f742b6fe9f11b3edd1664228b9 (patch)
tree69eea91bc519833eb479f342567e9667a289c34f /haddock-test/src/Test/Haddock
parentc2d2c481da18310053396bb0d2a9d070335eb865 (diff)
Implement output accepting mechanism in test package.
Diffstat (limited to 'haddock-test/src/Test/Haddock')
-rw-r--r--haddock-test/src/Test/Haddock/Config.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/haddock-test/src/Test/Haddock/Config.hs b/haddock-test/src/Test/Haddock/Config.hs
index 4f6bb818..451cd809 100644
--- a/haddock-test/src/Test/Haddock/Config.hs
+++ b/haddock-test/src/Test/Haddock/Config.hs
@@ -68,6 +68,7 @@ data Config c = Config
, cfgHaddockStdOut :: FilePath
, cfgDiffTool :: Maybe FilePath
, cfgEnv :: Environment
+ , cfgAccept :: Bool
, cfgCheckConfig :: CheckConfig c
, cfgDirConfig :: DirConfig
}
@@ -87,6 +88,7 @@ data Flag
| FlagHaddockStdOut FilePath
| FlagDiffTool FilePath
| FlagNoDiff
+ | FlagAccept
| FlagHelp
deriving Eq
@@ -118,6 +120,8 @@ options =
"where to redirect Haddock output"
, Option [] ["diff-tool"] (ReqArg FlagDiffTool "PATH")
"diff tool to use when printing failed cases"
+ , Option ['a'] ["accept"] (NoArg FlagAccept)
+ "accept generated output"
, Option [] ["no-diff"] (NoArg FlagNoDiff)
"do not print diff for failed cases"
, Option ['h'] ["help"] (NoArg FlagHelp)
@@ -178,6 +182,8 @@ loadConfig ccfg dcfg flags files = do
then pure Nothing
else (<|>) <$> pure (flagsDiffTool flags) <*> defaultDiffTool
+ let cfgAccept = FlagAccept `elem` flags
+
let cfgCheckConfig = ccfg
let cfgDirConfig = dcfg