2021-02-04 18:20:05 +03:00
|
|
|
module Main where
|
|
|
|
|
|
|
|
import Build_doctests (flags, pkgs, module_sources)
|
|
|
|
import Data.Foldable (traverse_)
|
2021-06-09 20:17:34 +03:00
|
|
|
import System.Environment.Compat (getArgs, unsetEnv)
|
2021-02-04 18:20:05 +03:00
|
|
|
import Test.DocTest (doctest)
|
|
|
|
|
2021-06-09 20:17:34 +03:00
|
|
|
import qualified Data.List as List
|
|
|
|
|
2021-02-04 18:20:05 +03:00
|
|
|
main :: IO ()
|
|
|
|
main = do
|
2021-06-09 20:17:34 +03:00
|
|
|
cliArgs <- getArgs
|
|
|
|
let (cliArgs1, mods) =
|
|
|
|
if (List.null (filter (== "--modules") cliArgs))
|
|
|
|
then (cliArgs, module_sources)
|
|
|
|
else (List.delete "--modules" cliArgs, [])
|
|
|
|
let args =
|
|
|
|
[ "-outputdir=./_doctests/"
|
|
|
|
, "-fobject-code"
|
|
|
|
, "--fast"
|
|
|
|
]
|
|
|
|
++ cliArgs1
|
|
|
|
++ flags
|
|
|
|
++ pkgs
|
|
|
|
++ mods
|
2021-02-04 18:20:05 +03:00
|
|
|
traverse_ putStrLn args
|
|
|
|
unsetEnv "GHC_ENVIRONMENT"
|
|
|
|
doctest args
|