Merge pull request #10662 from haskell/ulysses4ever-prerelease-cleanup-fixup
[cabal.git] / cabal-testsuite / PackageTests / GhcPkgGuess / SameDirectory / setup.test.hs
blob805f56abc9c25456a2628cd57e219af5eabe20a9
1 import Test.Cabal.Prelude
2 import System.Directory
4 main = setupAndCabalTest $ do
5 when isWindows $ do
6 sh <- fmap takeDirectory <$> liftIO (findExecutable "sh")
7 case sh of
8 Nothing -> skip "no sh"
9 Just sh' -> do
10 let sh'' = concatMap (\c -> case c of
11 '\\' -> "\\\\\\\\"
12 x -> [x]) sh'
13 void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc.shim", "ghc-pkg.shim"]
14 env <- getTestEnv
15 let cwd = testCurrentDir env
16 ghc_path <- programPathM ghcProgram
17 r <- withEnv [("WITH_GHC", Just ghc_path)]
18 . fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc.exe" else "ghc" ]
19 assertOutputContains "is version 9999999" r