1 import Test
.Cabal
.Prelude
2 import System
.Directory
-- (getDirectoryContents, removeFile)
4 cabal
"v2-build" ["inplace-dep"]
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 ()
16 (mapM_ (removeFile . (dir
</>)) . filter ((".ghc.environment" ==) . take 16))
17 =<< getDirectoryContents dir