-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doctests take extraordinarily long with doctest-0.12 on GHC 8.2.1 #756
Comments
Edit: Never mind, I'm guessing this was a Travis glitch, since restarting the GHC 8.2.1 build for |
Actually, the |
I'm guessing that there's some sort of quadratic slowdown occurring, since when I run the |
So this is interesting. I came up with a script that generates a single file with a configurable number of -- GenExample.hs
module Main where
import Control.Monad
import System.Environment
import System.Exit
import System.IO
main :: IO ()
main = do
args <- getArgs
case args of
n:_ -> genExamples (read n)
_ -> do hPutStrLn stderr "usage: runghc GenExamples.hs <num-examples>"
exitWith $ ExitFailure 1
genExamples :: Int -> IO ()
genExamples nExamples = do
putStrLn "module Example where"
ireplicateA_ nExamples genExample
genExample :: Int -> IO ()
genExample i = putStrLn $ unlines
[ "-- | Simple " ++ exampleName
, "-- >>> " ++ exampleName
, "-- 'a'"
, exampleName ++ " :: Char"
, exampleName ++ " = 'a'"
]
where
exampleName :: String
exampleName = "example" ++ show i
ireplicateA_ :: Applicative m => Int -> (Int -> m a) -> m ()
ireplicateA_ cnt0 f =
loop cnt0 0
where
loop cnt n
| cnt <= 0 = pure ()
| otherwise = f n *> (loop (cnt - 1) $! (n + 1)) You can create a file with an equal number of tests to Without
But if you run Keep in mind both of these tests were run with
It's not clear to me what changed in |
I've opened a corresponding |
Unfortunately, I suspect that a GHC 8.2.1-specific bug may be contributing here. See https://ghc.haskell.org/trac/ghc/ticket/14052. |
Oh dear, I had no idea preserving |
The short term workaround would be to make |
Note: the |
To be fair, it's GHC 8.2.1 that's at fault, not you ;) I think making |
sol/doctest#171 implements the |
This is fixed on |
After commit 378261d, which bumped the
doctest
upper version bounds to allowdoctest-0.12
, the Travis GHC 8.2.1 build began to time out when running thedoctests
test suite. Curiously, this doesn't appear to happen with any other version of GHC.The text was updated successfully, but these errors were encountered: