aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2017-11-27 23:27:54 +0200
committerDaniel Gröber <dxld@darkboxed.org>2018-01-18 14:10:26 +0100
commit07b4bbba1c312c385504b3def93607def2d5e4db (patch)
treee122c505b2f5a4db583fec49cde1afad97099ea4 /tests
parent3b7d095a2fde8c031a987dd00aff4ad8e7421cf0 (diff)
WIP on getting projects to build with Cabal 2.0/GHC 8.2
Diffstat (limited to 'tests')
-rw-r--r--tests/CompileTest.hs1
-rw-r--r--tests/GhcSession.hs16
-rw-r--r--tests/exeintlib/exeintlib.cabal (renamed from tests/exeintlib/exelib.cabal)0
3 files changed, 14 insertions, 3 deletions
diff --git a/tests/CompileTest.hs b/tests/CompileTest.hs
index de9b6ab..cc9c85a 100644
--- a/tests/CompileTest.hs
+++ b/tests/CompileTest.hs
@@ -97,6 +97,7 @@ main = do
, ("8.0.1", ">= 1.24 ")
, ("8.0.2", ">= 1.24.2 ")
, ("8.2.1", ">= 2.0.0.2 ")
+ , ("8.2.2", ">= 2.0.0.2 ")
]
relevant_cabal_versions =
diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs
index 42193b9..f627cae 100644
--- a/tests/GhcSession.hs
+++ b/tests/GhcSession.hs
@@ -27,8 +27,9 @@ main = do
args <- getArgs
topdir <- getCurrentDirectory
res <- mapM (setup topdir test) $ case args of
- [] -> [ ("tests/exelib" , parseVer "1.10")
- , ("tests/exeintlib", parseVer "2.0")
+ [] -> [
+ -- ("tests/exelib" , parseVer "1.10")
+ ("tests/exeintlib", parseVer "2.0")
]
xs -> map (,parseVer "0") xs
@@ -49,6 +50,7 @@ setup :: FilePath -> (FilePath -> IO [Bool]) -> (FilePath, Version) -> IO [Bool]
setup topdir act (srcdir, min_cabal_ver) = do
ci_ver <- cabalInstallVersion
c_ver <- cabalInstallBuiltinCabalVersion
+ putStrLn $ "(ci_ver,c_ver)=" ++ show (ci_ver,c_ver) -- AZ-DEBUG
let mreason
| (ci_ver < parseVer "1.24") =
Just $ "cabal-install-" ++ showVersion ci_ver ++ " is too old"
@@ -63,7 +65,9 @@ setup topdir act (srcdir, min_cabal_ver) = do
putStrLn $ "Skipping test '" ++ srcdir ++ "' because " ++ reason ++ "."
return []
Nothing -> do
- withSystemTempDirectory "cabal-helper.ghc-session.test" $ \dir -> do
+ -- withSystemTempDirectory "cabal-helper.ghc-session.test" $ \dir -> do
+ let dir = "/tmp/xxx"
+ do
setCurrentDirectory $ topdir </> srcdir
run "cabal" [ "sdist", "--output-dir", dir ]
@@ -76,7 +80,9 @@ setup topdir act (srcdir, min_cabal_ver) = do
run x xs = do
print $ x:xs
o <- readProcess x xs ""
+ putStrLn "=======================output============" -- AZ-DEBUG
putStrLn o
+ putStrLn "=======================output-done=======" -- AZ-DEBUG
return ()
test :: FilePath -> IO [Bool]
@@ -85,7 +91,9 @@ test dir = do
cs <- runQuery qe $ components $ (,,) <$> entrypoints <.> ghcOptions
forM cs $ \(ep, opts, cn) -> do
let sopts = intercalate " " $ map formatArg $ "ghc" : opts
+ putStrLn "======================= cn ============" -- AZ-DEBUG
putStrLn $ "\n" ++ show cn ++ ": " ++ sopts
+ putStrLn "======================= cn done =======" -- AZ-DEBUG
compileModule ep opts
where
formatArg x
@@ -95,6 +103,8 @@ test dir = do
compileModule :: ChEntrypoint -> [String] -> IO Bool
compileModule ep opts = do
+ putStrLn $ "compileModule:ep=" ++ show ep
+
E.handle (\(ec :: ExitCode) -> print ec >> return False) $ do
defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
diff --git a/tests/exeintlib/exelib.cabal b/tests/exeintlib/exeintlib.cabal
index 807aac5..807aac5 100644
--- a/tests/exeintlib/exelib.cabal
+++ b/tests/exeintlib/exeintlib.cabal