Add “Ignore warning” option to cabal check
[cabal.git] / cabal-testsuite / PackageTests / NewBuild / CmdExec / GhcInvocation / cabal.test.hs
blob5c1384dfdcaebe88c7616c8e04954c4cc47479d5
1 import Test.Cabal.Prelude
2 import System.Directory-- (getDirectoryContents, removeFile)
3 main = cabalTest $ do
4 cabal "v2-build" ["inplace-dep"]
5 env <- getTestEnv
6 liftIO $ removeEnvFiles $ testSourceDir env -- we don't want existing env files to interfere
7 -- Drop the compiled executable into the temporary directory, to avoid cluttering the tree. If compilation succeeds, we've tested what we need to!
8 tmpdir <- fmap testTmpDir getTestEnv
9 let dest = tmpdir </> "a.out"
10 cabal "v2-exec" ["ghc", "--", "Main.hs", "-o", dest]
11 -- TODO external (store) deps, once v2-install is working
13 -- copy-pasted from D.C.CmdClean.
14 removeEnvFiles :: FilePath -> IO ()
15 removeEnvFiles dir =
16 (mapM_ (removeFile . (dir </>)) . filter ((".ghc.environment" ==) . take 16))
17 =<< getDirectoryContents dir