Commit 722e030f authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Hide StructDiff behind the flag

parent 512db606
......@@ -327,6 +327,11 @@ flag parsec
default: False
manual: True
flag parsec-struct-diff
description: Use StructDiff in parsec tests. Affects only parsec tests.
default: False
manual: True
library
build-depends:
array >= 0.1 && < 0.6,
......@@ -648,9 +653,7 @@ test-suite parser-tests
type: exitcode-stdio-1.0
main-is: ParserTests.hs
other-modules:
DiffInstances
StructDiff
hs-source-dirs: tests
build-depends:
base,
......@@ -659,11 +662,19 @@ test-suite parser-tests
bytestring,
directory,
filepath,
generics-sop ==0.2.*,
these >=0.7.1 && <0.8,
singleton-bool >=0.1.1.0 && <0.2,
keys,
Cabal
if flag(parsec-struct-diff)
build-depends:
generics-sop ==0.2.*,
these >=0.7.1 && <0.8,
singleton-bool >=0.1.1.0 && <0.2,
keys
other-modules:
DiffInstances
StructDiff
cpp-options: -DHAS_STRUCT_DIFF
ghc-options: -Wall -rtsopts
default-extensions: CPP
default-language: Haskell2010
......@@ -30,8 +30,10 @@ import qualified Distribution.Parsec.Types.Common as Parsec
import qualified Distribution.Parsec.Types.ParseResult as Parsec
import qualified Distribution.ParseUtils as ReadP
#ifdef HAS_STRUCT_DIFF
import DiffInstances ()
import StructDiff
#endif
parseIndex :: Monoid a => (FilePath -> BSL.ByteString -> IO a) -> IO a
parseIndex action = do
......@@ -100,14 +102,15 @@ compareTest pfx fpath bsl
if readp0 == parsec0
then return ()
else do
{-
#if HAS_STRUCT_DIFF
prettyResultIO $ diff readp parsec
#else
putStrLn "<<<<<<"
print readp
print readp0
putStrLn "======"
print parsec
print parsec0
putStrLn ">>>>>>"
-}
prettyResultIO $ diff readp parsec
#endif
exitFailure
let readpWarnCount = Sum (length readpWarnings)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment