From acf526f68d0ecb3ddf4ddd6efcee7774cd8ffa54 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Wed, 19 Aug 2015 14:43:39 +0200 Subject: Setup test suite for Hoogle backend. --- haddock.cabal | 7 +++++++ hoogle-test/Main.hs | 27 +++++++++++++++++++++++++++ hoogle-test/run | 5 +++++ 3 files changed, 39 insertions(+) create mode 100644 hoogle-test/Main.hs create mode 100755 hoogle-test/run diff --git a/haddock.cabal b/haddock.cabal index ea214869..aba0c394 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -144,6 +144,13 @@ test-suite latex-test hs-source-dirs: latex-test build-depends: base, filepath, haddock-test +test-suite hoogle-test + type: exitcode-stdio-1.0 + default-language: Haskell2010 + main-is: Main.hs + hs-source-dirs: hoogle-test + build-depends: base, filepath, haddock-test + source-repository head type: git location: https://github.com/haskell/haddock.git diff --git a/hoogle-test/Main.hs b/hoogle-test/Main.hs new file mode 100644 index 00000000..9da20c36 --- /dev/null +++ b/hoogle-test/Main.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE CPP #-} + + +import System.Environment +import System.FilePath + +import Test.Haddock + + +checkConfig :: CheckConfig String +checkConfig = CheckConfig + { ccfgRead = \_ input -> Just input + , ccfgDump = id + , ccfgEqual = (==) + } + + +dirConfig :: DirConfig +dirConfig = defaultDirConfig $ takeDirectory __FILE__ + + +main :: IO () +main = do + cfg <- parseArgs checkConfig dirConfig =<< getArgs + runAndCheck $ cfg + { cfgHaddockArgs = cfgHaddockArgs cfg ++ ["--hoogle"] + } diff --git a/hoogle-test/run b/hoogle-test/run new file mode 100755 index 00000000..5e17ad0f --- /dev/null +++ b/hoogle-test/run @@ -0,0 +1,5 @@ +#!/bin/bash + +export HADDOCK_PATH=$(which haddock) +LIB_PATH="$(dirname "$BASH_SOURCE")/../haddock-test/src/" +runhaskell -i:"$LIB_PATH" "Main.hs" $@ -- cgit v1.2.3