removing warnings from spec.

This commit is contained in:
Kazu Yamamoto
2014-08-20 12:14:27 +09:00
parent 190dc2ac51
commit 1e1505c535
10 changed files with 18 additions and 31 deletions

View File

@@ -2,20 +2,21 @@
import Spec
import Dir
import Test.Hspec
import System.Process
import Language.Haskell.GhcMod (debugInfo, defaultOptions, findCradle)
import Control.Exception as E
import Control.Monad (void)
import Language.Haskell.GhcMod (debugInfo)
import System.Process
import Test.Hspec
import TestUtils
main :: IO ()
main = do
let sandboxes = [ "test/data", "test/data/check-packageid"
, "test/data/duplicate-pkgver/"
, "test/data/broken-cabal/"
]
genSandboxCfg dir = withDirectory dir $ \cwd -> do
system ("sed 's|@CWD@|" ++ cwd ++ "|g' cabal.sandbox.config.in > cabal.sandbox.config")
genSandboxCfg dir = withDirectory dir $ \cwdir -> do
system ("sed 's|@CWD@|" ++ cwdir ++ "|g' cabal.sandbox.config.in > cabal.sandbox.config")
pkgDirs =
[ "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"
, "test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"
@@ -23,10 +24,10 @@ main = do
genGhcPkgCache dir = system $ "ghc-pkg recache --force -f" ++ dir
genSandboxCfg `mapM_` sandboxes
genGhcPkgCache `mapM_` pkgDirs
system "find test -name setup-config -name ghc-mod.cache -exec rm {} \\;"
system "cabal --version"
void $ system "find test -name setup-config -name ghc-mod.cache -exec rm {} \\;"
void $ system "cabal --version"
putStrLn $ "ghc-mod was built with Cabal version " ++ VERSION_Cabal
system "ghc --version"
void $ system "ghc --version"
(putStrLn =<< runD debugInfo)
`E.catch` (\(_ :: E.SomeException) -> return () )