aboutsummaryrefslogtreecommitdiff
path: root/org-test/Main.hs
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-08-16 12:24:49 +1000
committerYuchen Pei <hi@ypei.me>2022-08-16 12:24:49 +1000
commit4a2ad11155014bcf13a7dbd7f6b9e2c530ac3b79 (patch)
treec2278ef2c10bf9ff9f4c656438ec78fdeb565f0e /org-test/Main.hs
parenta173cbc219b58b8042a7e4f0c57fc956f257191f (diff)
Adding initial test for the org backend.
Diffstat (limited to 'org-test/Main.hs')
-rw-r--r--org-test/Main.hs35
1 files changed, 35 insertions, 0 deletions
diff --git a/org-test/Main.hs b/org-test/Main.hs
new file mode 100644
index 00000000..01658fd9
--- /dev/null
+++ b/org-test/Main.hs
@@ -0,0 +1,35 @@
+{-# LANGUAGE CPP #-}
+
+
+import Data.Function
+import System.Environment
+import System.FilePath
+
+import Test.Haddock
+import Test.Haddock.Utils
+
+
+checkConfig :: CheckConfig String
+checkConfig = CheckConfig
+ { ccfgRead = Just
+ , ccfgClean = const id
+ , ccfgDump = id
+ , ccfgEqual = (==)
+ }
+
+
+dirConfig :: DirConfig
+dirConfig = (defaultDirConfig $ takeDirectory __FILE__)
+ { dcfgCheckIgnore = checkIgnore
+ }
+
+
+main :: IO ()
+main = do
+ cfg <- parseArgs checkConfig dirConfig =<< getArgs
+ runAndCheck $ cfg
+ { cfgHaddockArgs = cfgHaddockArgs cfg ++ ["--org"]
+ }
+
+checkIgnore :: FilePath -> Bool
+checkIgnore file = takeExtension file /= ".org"