fix doctests for cabal-install-1.18
This commit is contained in:
parent
07f8b6a28a
commit
0d47f4527b
4 changed files with 28 additions and 2 deletions
|
@ -113,6 +113,8 @@ test-suite doctests
|
|||
, servant
|
||||
, doctest
|
||||
, filemanip
|
||||
, directory
|
||||
, filepath
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: test/Doctests.hs
|
||||
buildable: True
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
module Main where
|
||||
|
||||
import Data.List (isPrefixOf)
|
||||
import System.Directory
|
||||
import System.FilePath
|
||||
import System.FilePath.Find
|
||||
import Test.DocTest
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
files <- find always (extension ==? ".hs") "src"
|
||||
cabalMacrosFile <- getCabalMacrosFile
|
||||
doctest $ [ "-isrc"
|
||||
, "-optP-include"
|
||||
, "-optPdist/build/autogen/cabal_macros.h"
|
||||
, "-optP" ++ cabalMacrosFile
|
||||
, "-XOverloadedStrings"
|
||||
, "-XFlexibleInstances"
|
||||
, "-XMultiParamTypeClasses"
|
||||
|
@ -16,3 +20,10 @@ main = do
|
|||
, "-XTypeOperators"
|
||||
] ++ files
|
||||
|
||||
getCabalMacrosFile :: IO FilePath
|
||||
getCabalMacrosFile = do
|
||||
contents <- getDirectoryContents "dist"
|
||||
let rest = "build" </> "autogen" </> "cabal_macros.h"
|
||||
return $ case filter ("dist-sandbox-" `isPrefixOf`) contents of
|
||||
[x] -> "dist" </> x </> rest
|
||||
[] -> "dist" </> rest
|
||||
|
|
|
@ -107,6 +107,8 @@ test-suite doctests
|
|||
, servant
|
||||
, doctest
|
||||
, filemanip
|
||||
, directory
|
||||
, filepath
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: test/Doctests.hs
|
||||
buildable: True
|
||||
|
|
|
@ -1,16 +1,27 @@
|
|||
module Main where
|
||||
|
||||
import Data.List (isPrefixOf)
|
||||
import System.Directory
|
||||
import System.FilePath
|
||||
import System.FilePath.Find
|
||||
import Test.DocTest
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
files <- find always (extension ==? ".hs") "src"
|
||||
cabalMacrosFile <- getCabalMacrosFile
|
||||
doctest $ [ "-isrc"
|
||||
, "-optP-include"
|
||||
, "-optPdist/build/autogen/cabal_macros.h"
|
||||
, "-optP" ++ cabalMacrosFile
|
||||
, "-XOverloadedStrings"
|
||||
, "-XFlexibleInstances"
|
||||
, "-XMultiParamTypeClasses"
|
||||
] ++ files
|
||||
|
||||
getCabalMacrosFile :: IO FilePath
|
||||
getCabalMacrosFile = do
|
||||
contents <- getDirectoryContents "dist"
|
||||
let rest = "build" </> "autogen" </> "cabal_macros.h"
|
||||
return $ case filter ("dist-sandbox-" `isPrefixOf`) contents of
|
||||
[x] -> "dist" </> x </> rest
|
||||
[] -> "dist" </> rest
|
||||
|
|
Loading…
Reference in a new issue