Un-ignore .bat files
[cabal.git] / cabal-testsuite / PackageTests / InternalLibraries / setup-gen-pkg-config.test.hs
blob4ebc3a3f5c6e2f504976e77396a96eff4dd34143
1 import Test.Cabal.Prelude
2 import Control.Monad
3 import Control.Monad.IO.Class
4 import System.Directory
5 import Data.List
6 -- Test to see if --gen-pkg-config works.
7 main = setupAndCabalTest $ do
8 withPackageDb $ do
9 withDirectory "p" $ do
10 setup_build []
11 setup "copy" []
12 let dir = "pkg-config.bak"
13 setup "register" ["--gen-pkg-config=" ++ dir]
14 -- Infelicity! Does not respect CWD.
15 env <- getTestEnv
16 let cwd = testCurrentDir env
17 notHidden = not . isHidden
18 isHidden name = "." `isPrefixOf` name
19 confs <- fmap (sort . filter notHidden)
20 . liftIO $ getDirectoryContents (cwd </> dir)
21 forM_ confs $ \conf -> ghcPkg "register" [cwd </> dir </> conf]
23 -- Make sure we can see p
24 withDirectory "r" $ setup_install []