From 66d7114dc8d310e1dc1105a0805c1c491312b43c Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Thu, 13 Aug 2015 17:28:24 +0200 Subject: Make Haddock test package more generic. --- html-test/run.hs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'html-test/run.hs') diff --git a/html-test/run.hs b/html-test/run.hs index 48c733d0..22a06ba3 100755 --- a/html-test/run.hs +++ b/html-test/run.hs @@ -5,16 +5,26 @@ import System.Environment import System.FilePath import Test.Haddock +import Test.Haddock.Xhtml +import qualified Text.XML.Light as Xml -baseDir :: FilePath -baseDir = takeDirectory __FILE__ + +checkConfig :: CheckConfig Xml.Element +checkConfig = CheckConfig + { ccfgRead = \_ input -> strip <$> Xml.parseXMLDoc input + , ccfgDump = Xml.ppElement + , ccfgEqual = (==) + } + + +dirConfig :: DirConfig +dirConfig = defaultDirConfig $ takeDirectory __FILE__ main :: IO () main = do - let dcfg = defaultDirConfig baseDir - cfg <- uncurry (loadConfig dcfg) =<< checkOpt =<< getArgs + cfg <- uncurry (loadConfig checkConfig dirConfig) =<< checkOpt =<< getArgs runHaddock cfg checkFiles cfg -- cgit v1.2.3