Skip to content
Snippets Groups Projects
Commit b2e4856e authored by Javier Sagredo's avatar Javier Sagredo
Browse files

Enable autoreconf tests on Windows

parent 7e0db765
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,26 @@ import Test.Cabal.Prelude
import Control.Monad.IO.Class
import Data.Maybe
import System.Directory
import System.Environment
import Data.List (isSuffixOf)
-- Test for 'build-type: Configure' example from the setup manual.
main = cabalTest $ do
hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf"
skipUnless "no autoreconf" hasAutoreconf
_ <- shell "autoreconf" ["-i"]
cabal "v2-build" []
if isWindows
then do
(mCI, mSh) <- liftIO $ (,) <$> lookupEnv "CI" <*> lookupEnv "SHELL"
case (mCI, mSh) of
(Nothing, Nothing) -> skip "Missing $SHELL"
(Nothing, Just sh) -> do
env <- getTestEnv
void $ shell sh [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"]
cabal "v2-build" []
(Just{}, _) -> do
env <- getTestEnv
void $ shell "C:\\msys64\\usr\\bin\\bash.exe" [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"]
cabal "v2-build" []
else do
hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf"
skipUnless "no autoreconf" hasAutoreconf
_ <- shell "autoreconf" ["-i"]
cabal "v2-build" []
......@@ -2,9 +2,25 @@ import Test.Cabal.Prelude
import Control.Monad.IO.Class
import Data.Maybe
import System.Directory
import System.Environment
-- Test for 'build-type: Configure' example from the setup manual.
main = setupTest $ do
hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf"
skipUnless "no autoreconf" hasAutoreconf
_ <- shell "autoreconf" ["-i"]
setup_build []
main = setupTest $
if isWindows
then do
(mCI, mSh) <- liftIO $ (,) <$> lookupEnv "CI" <*> lookupEnv "SHELL"
case (mCI, mSh) of
(Nothing, Nothing) -> skip "Missing $SHELL"
(Nothing, Just sh) -> do
env <- getTestEnv
void $ shell sh [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"]
setup_build []
(Just{}, _) -> do
env <- getTestEnv
void $ shell "C:\\msys64\\usr\\bin\\bash.exe" [ "-l", "-c", "cd $(cygpath -m '" <> testTmpDir env <> "') && autoreconf -i"]
setup_build []
else do
hasAutoreconf <- liftIO $ fmap isJust $ findExecutable "autoreconf"
skipUnless "no autoreconf" hasAutoreconf
_ <- shell "autoreconf" ["-i"]
setup_build []
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment