Let doctests accept actual distdir from env

This commit is contained in:
Nikolay Yakimov 2016-08-09 14:27:51 +03:00
parent bb754b896f
commit e8f42af74b

View File

@ -2,16 +2,20 @@
module Main where module Main where
import Test.DocTest import Test.DocTest
import System.Environment
import Data.Maybe
main :: IO () main :: IO ()
main = doctest main = do
[ "-package", "ghc-" ++ VERSION_ghc distdir <- (fromMaybe "dist" . lookup "DOCTEST_DIST_DIR") `fmap` getEnvironment
, "-package", "transformers-" ++ VERSION_transformers doctest
, "-package", "mtl-" ++ VERSION_mtl [ "-package", "ghc-" ++ VERSION_ghc
, "-package", "directory-" ++ VERSION_directory , "-package", "transformers-" ++ VERSION_transformers
, "-XScopedTypeVariables", "-XRecordWildCards", "-XNamedFieldPuns", "-XConstraintKinds", "-XFlexibleContexts", "-XDataKinds", "-XKindSignatures", "-XTypeOperators", "-XViewPatterns" , "-package", "mtl-" ++ VERSION_mtl
, "-idist/build/autogen/" , "-package", "directory-" ++ VERSION_directory
, "-optP-include" , "-XScopedTypeVariables", "-XRecordWildCards", "-XNamedFieldPuns", "-XConstraintKinds", "-XFlexibleContexts", "-XDataKinds", "-XKindSignatures", "-XTypeOperators", "-XViewPatterns"
, "-optPdist/build/autogen/cabal_macros.h" , "-i" ++ distdir ++ "/build/autogen/"
, "Language/Haskell/GhcMod.hs" , "-optP-include"
] , "-optP" ++ distdir ++ "/build/autogen/cabal_macros.h"
, "Language/Haskell/GhcMod.hs"
]