diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2017-11-27 23:27:54 +0200 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2018-01-18 14:10:26 +0100 |
commit | 07b4bbba1c312c385504b3def93607def2d5e4db (patch) | |
tree | e122c505b2f5a4db583fec49cde1afad97099ea4 /tests/GhcSession.hs | |
parent | 3b7d095a2fde8c031a987dd00aff4ad8e7421cf0 (diff) |
WIP on getting projects to build with Cabal 2.0/GHC 8.2
Diffstat (limited to 'tests/GhcSession.hs')
-rw-r--r-- | tests/GhcSession.hs | 16 |
1 files changed, 13 insertions, 3 deletions
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 |