make LTS branch pre-releases
[cabal.git] / cabal-testsuite / PackageTests / Configure / cabal.test.hs
blobcd419e8cee2986a14910ee93dfe002bc6cb4efbc
1 import Test.Cabal.Prelude
2 import Control.Monad.IO.Class
3 import Data.Maybe
4 import System.Directory
5 import System.Environment
6 import Data.List (isSuffixOf)
8 -- Test for 'build-type: Configure' example from the setup manual.
9 main = cabalTest $ do
10 if isWindows
11 then do
12 (mCI, mSh) <- liftIO $ (,) <$> lookupEnv "CI" <*> lookupEnv "SHELL"
13 case (mCI, mSh) of
14 (Nothing, Nothing) -> skip "Missing $SHELL"
15 (Nothing, Just sh) -> do
16 env <- getTestEnv
17 void $ shell sh [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"]
18 cabal "v2-build" []
19 (Just{}, _) -> do
20 env <- getTestEnv
21 void $ shell "C:\\msys64\\usr\\bin\\bash.exe" [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"]
22 cabal "v2-build" []
23 else do
24 hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf"
25 skipUnless "no autoreconf" hasAutoreconf
26 _ <- shell "autoreconf" ["-i"]
27 cabal "v2-build" []