Create changelogs for 3.14.1.0 (#10591)
[cabal.git] / cabal-testsuite / PackageTests / GhcPkgGuess / SymlinkVersion / setup.test.hs
blob2f406ce62262917fd657d658ff2f0e38d973e423
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", "bin/ghc-7.10.shim", "bin/ghc-pkg-ghc-7.10.shim"]
14 (if isWindows
15 then withSymlink "bin/ghc-7.10.exe" "ghc.exe" . withSymlink "bin/ghc-7.10.shim" "ghc.shim" . withSymlink "bin/ghc-7.10" "ghc"
16 else withSymlink "bin/ghc-7.10" "ghc") $ do
17 env <- getTestEnv
18 let cwd = testCurrentDir env
19 ghc_path <- programPathM ghcProgram
20 r <- withEnv [("WITH_GHC", Just ghc_path)]
21 . fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc.exe" else "ghc"]
22 assertOutputContains "is version 9999999" r