Skip to content
Snippets Groups Projects
Commit 6dfe46bb authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Enable TemplateHaskell/dynamic on Travis for all GHC versions.

parent 811a945e
No related branches found
No related tags found
No related merge requests found
...@@ -12,11 +12,8 @@ env: ...@@ -12,11 +12,8 @@ env:
before_install: before_install:
- sudo add-apt-repository -y ppa:hvr/ghc - sudo add-apt-repository -y ppa:hvr/ghc
- sudo apt-get update - sudo apt-get update
- sudo apt-get install cabal-install-1.18 ghc-$GHCVER-prof happy - sudo apt-get install cabal-install-1.18 ghc-$GHCVER-prof ghc-$GHCVER-dyn happy
- export PATH=/opt/ghc/$GHCVER/bin:$PATH - export PATH=/opt/ghc/$GHCVER/bin:$PATH
- if [ $GHCVER != 7.8.1 ] && [ $GHCVER != head ]; then
export CABAL_TEST_NO_GHC_DYN=1;
fi
install: install:
- sudo /opt/ghc/$GHCVER/bin/ghc-pkg recache - sudo /opt/ghc/$GHCVER/bin/ghc-pkg recache
......
...@@ -58,7 +58,7 @@ hunit :: TestName -> HUnit.Test -> Test ...@@ -58,7 +58,7 @@ hunit :: TestName -> HUnit.Test -> Test
hunit name test = testGroup name $ hUnitTestToTests test hunit name test = testGroup name $ hUnitTestToTests test
tests :: Version -> PackageSpec -> FilePath -> FilePath -> Bool -> [Test] tests :: Version -> PackageSpec -> FilePath -> FilePath -> Bool -> [Test]
tests version inplaceSpec ghcPath ghcPkgPath noGHCDyn = tests version inplaceSpec ghcPath ghcPkgPath =
[ hunit "BuildDeps/SameDepsAllRound" [ hunit "BuildDeps/SameDepsAllRound"
(PackageTests.BuildDeps.SameDepsAllRound.Check.suite ghcPath) (PackageTests.BuildDeps.SameDepsAllRound.Check.suite ghcPath)
-- The two following tests were disabled by Johan Tibell as -- The two following tests were disabled by Johan Tibell as
...@@ -98,14 +98,9 @@ tests version inplaceSpec ghcPath ghcPkgPath noGHCDyn = ...@@ -98,14 +98,9 @@ tests version inplaceSpec ghcPath ghcPkgPath noGHCDyn =
(PackageTests.BuildTestSuiteDetailedV09.Check.suite inplaceSpec ghcPath) (PackageTests.BuildTestSuiteDetailedV09.Check.suite inplaceSpec ghcPath)
, hunit "OrderFlags" , hunit "OrderFlags"
(PackageTests.OrderFlags.Check.suite ghcPath) (PackageTests.OrderFlags.Check.suite ghcPath)
, hunit "TemplateHaskell/dynamic"
(PackageTests.TemplateHaskell.Check.dynamic ghcPath)
] ++ ] ++
-- These tests are expected to fail on some Travis configurations because
-- hvr's pre-7.8 PPA GHCs don't include dynamic libs.
(if not noGHCDyn
then [ hunit "TemplateHaskell/dynamic"
(PackageTests.TemplateHaskell.Check.dynamic ghcPath)
]
else []) ++
-- These tests are only required to pass on cabal version >= 1.7 -- These tests are only required to pass on cabal version >= 1.7
(if version >= Version [1, 7] [] (if version >= Version [1, 7] []
then [ hunit "BuildDeps/TargetSpecificDeps1" then [ hunit "BuildDeps/TargetSpecificDeps1"
...@@ -147,20 +142,9 @@ main = do ...@@ -147,20 +142,9 @@ main = do
putStrLn $ "Using ghc: " ++ ghcPath putStrLn $ "Using ghc: " ++ ghcPath
putStrLn $ "Using ghc-pkg: " ++ ghcPkgPath putStrLn $ "Using ghc-pkg: " ++ ghcPkgPath
setCurrentDirectory "tests" setCurrentDirectory "tests"
-- Does this GHC have dynamic libs installed?
noGHCDyn <- checkNoGHCDyn
-- Create a shared Setup executable to speed up Simple tests -- Create a shared Setup executable to speed up Simple tests
compileSetup "." ghcPath compileSetup "." ghcPath
defaultMain (tests cabalVersion inplaceSpec defaultMain (tests cabalVersion inplaceSpec ghcPath ghcPkgPath)
ghcPath ghcPkgPath noGHCDyn)
-- | Are dynamic libraries installed? Travis build bot doesn't have dynamic libs
-- for all configurations.
checkNoGHCDyn :: IO Bool
checkNoGHCDyn = fmap isJust (lookupEnv "CABAL_TEST_NO_GHC_DYN")
where
lookupEnv :: String -> IO (Maybe String)
lookupEnv name = (Just `fmap` getEnv name) `catchIO` const (return Nothing)
-- Like Distribution.Simple.Configure.getPersistBuildConfig but -- Like Distribution.Simple.Configure.getPersistBuildConfig but
-- doesn't check that the Cabal version matches, which it doesn't when -- doesn't check that the Cabal version matches, which it doesn't when
......
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