]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - test/Doctests.hs
Use filemanip to automatically doctest all source files.
[numerical-analysis.git] / test / Doctests.hs
index 3ce1b4a04c736bc5bfaa9346430a3145e5d59d7c..3cfd2a83cfbe679a541b18ac509f0780e175f552 100644 (file)
@@ -2,8 +2,12 @@ module Main
 where
 
 import Test.DocTest
+import System.FilePath.Find ((==?), always, extension, find)
+
+find_sources :: IO [FilePath]
+find_sources = find always (extension ==? ".hs") "src/"
 
 main :: IO ()
-main = doctest ["--optghc=-isrc",
-                "src/Roots/Simple.hs",
-                "src/Roots/Fast.hs"]
+main = do
+  sources <- find_sources
+  doctest $ ["-isrc"] ++ sources