From 473fa805d50037edc3bf82a7e2bad405d81402fc Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Sun, 11 Feb 2018 21:16:19 +0200 Subject: [PATCH 1/4] Working on the failing tests --- test/CabalHelperSpec.hs | 2 +- test/CheckSpec.hs | 6 ++++-- test/TestUtils.hs | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/CabalHelperSpec.hs b/test/CabalHelperSpec.hs index f2119b024..43cd33506 100644 --- a/test/CabalHelperSpec.hs +++ b/test/CabalHelperSpec.hs @@ -86,7 +86,7 @@ spec = do opts <- map gmcGhcOpts <$> runD' tdir getComponents let ghcOpts = head opts pkgs = pkgOptions ghcOpts - pkgs `shouldBe` ["Cabal","base"] + pkgs `shouldBe` ["base","Cabal"] test diff --git a/test/CheckSpec.hs b/test/CheckSpec.hs index efe024cd2..c14d1603c 100644 --- a/test/CheckSpec.hs +++ b/test/CheckSpec.hs @@ -64,8 +64,10 @@ spec = do it "works with cabal builtin preprocessors" $ do withDirectory_ "test/data/cabal-preprocessors" $ do _ <- system "cabal clean" - _ <- system "cabal build" - res <- runD $ checkSyntax ["Main.hs"] + -- _ <- system "cabal build" + _ <- system "cabal build -v3" + -- res <- runD $ checkSyntax ["Main.hs"] + res <- runV $ checkSyntax ["Main.hs"] res `shouldBe` "Preprocessed.hsc:3:1:Warning: Top-level binding with no type signature: warning :: ()\n" it "Uses the right qualification style" $ do diff --git a/test/TestUtils.hs b/test/TestUtils.hs index 3d252f151..e487a22a5 100644 --- a/test/TestUtils.hs +++ b/test/TestUtils.hs @@ -3,6 +3,7 @@ module TestUtils ( run , runD , runD' + , runV , runE , runNullLog , runGmOutDef @@ -77,6 +78,11 @@ runD' :: FilePath -> GhcModT IO a -> IO a runD' dir = extract . runGhcModTSpec' dir (setLogLevel testLogLevel defaultOptions) +-- | Run GhcMod with default options +runV :: GhcModT IO a -> IO a +runV = + extract . runGhcModTSpec (setLogLevel GmVomit defaultOptions) + setLogLevel :: GmLogLevel -> Options -> Options setLogLevel = set (lOoptLogLevel . lOptOutput) From 9fd0cf50c4be4d36c05d5e51c508228fa01de382 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Sun, 11 Mar 2018 11:14:02 +0200 Subject: [PATCH 2/4] Add cabal-helper local copy --- cabal.project | 1 + 1 file changed, 1 insertion(+) diff --git a/cabal.project b/cabal.project index 0d3711349..4b8b8e5f2 100644 --- a/cabal.project +++ b/cabal.project @@ -1,2 +1,3 @@ packages: . ./core + ../cabal-helper From c1b569450c8cc4ca8bcc9a581fe20ba46ec58a8b Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Fri, 13 Apr 2018 17:11:19 +0200 Subject: [PATCH 3/4] Remove redundant packages, bump haskell-src-exts upper bound --- core/ghc-mod-core.cabal | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/core/ghc-mod-core.cabal b/core/ghc-mod-core.cabal index e077f3a61..215e67c43 100644 --- a/core/ghc-mod-core.cabal +++ b/core/ghc-mod-core.cabal @@ -88,31 +88,25 @@ Library , directory , filepath , mtl - , old-time , process , template-haskell , time , transformers , base < 4.11 && >= 4.6.0.1 - , djinn-ghc < 0.1 && >= 0.0.2.2 , extra < 1.7 && >= 1.4 , fclabels < 2.1 && >= 2.0 - , fingertree < 0.2 && >= 0.1.1.0 , ghc-paths < 0.2 && >= 0.1.0.9 , ghc-syb-utils < 0.3 && >= 0.2.3 - , haskell-src-exts < 1.20 && >= 1.18 - , hlint < 3.0 && >= 2.0.8 + , haskell-src-exts < 1.21 && >= 1.18 , monad-control < 1.1 && >= 1 , monad-journal < 0.9 && >= 0.4 , optparse-applicative < 0.15 && >= 0.13.0.0 , pipes < 4.4 && >= 4.1 , safe < 0.4 && >= 0.3.9 - , semigroups < 0.19 && >= 0.10.0 , split < 0.3 && >= 0.2.2 , syb < 0.8 && >= 0.5.1 , temporary < 1.3 && >= 1.2.0.3 - , text < 1.3 && >= 1.2.1.3 , transformers-base < 0.5 && >= 0.4.4 , cabal-helper < 0.9 && >= 0.8.0.2 From 312c0c1cf1ac5ffd24d86ac2a11ea822f6d6879f Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Fri, 13 Apr 2018 17:47:23 +0200 Subject: [PATCH 4/4] Relax various upper bounds --- ghc-mod.cabal | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index aebb03876..186b203bb 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -137,16 +137,16 @@ Library , base < 4.11 && >= 4.6.0.1 , djinn-ghc < 0.1 && >= 0.0.2.2 - , extra < 1.6 && >= 1.4 + , extra < 1.7 && >= 1.4 , fclabels < 2.1 && >= 2.0 , ghc-paths < 0.2 && >= 0.1.0.9 , ghc-syb-utils < 0.3 && >= 0.2.3 , ghc-mod-core == 5.9.0.0 - , haskell-src-exts < 1.20 && >= 1.18 - , hlint < 2.1 && >= 2.0.8 + , haskell-src-exts < 1.21 && >= 1.18 + , hlint < 2.2 && >= 2.0.8 , monad-control < 1.1 && >= 1 - , monad-journal < 0.8 && >= 0.4 - , optparse-applicative < 0.14 && >= 0.13.0.0 + , monad-journal < 0.9 && >= 0.4 + , optparse-applicative < 0.15 && >= 0.13.0.0 , pipes < 4.4 && >= 4.1 , safe < 0.4 && >= 0.3.9 , semigroups < 0.19 && >= 0.10.0 @@ -158,7 +158,6 @@ Library , cabal-helper < 0.9 && >= 0.8.0.0 , ghc < 8.4 && >= 7.8 - , ghc-mod-core if impl(ghc >= 8.0) Build-Depends: ghc-boot @@ -185,7 +184,7 @@ Executable ghc-mod , base < 4.11 && >= 4.6.0.1 , fclabels < 2.1 && >= 2.0 , monad-control < 1.1 && >= 1 - , optparse-applicative < 0.14 && >= 0.13.0.0 + , optparse-applicative < 0.15 && >= 0.13.0.0 , semigroups < 0.19 && >= 0.10.0 , split < 0.3 && >= 0.2.2 @@ -275,8 +274,8 @@ Test-Suite spec , base < 4.11 && >= 4.6.0.1 , fclabels < 2.1 && >= 2.0 - , hspec < 2.5 && >= 2.0.0 - , monad-journal < 0.8 && >= 0.4 + , hspec < 2.6 && >= 2.0.0 + , monad-journal < 0.9 && >= 0.4 , split < 0.3 && >= 0.2.2 , temporary < 1.3 && >= 1.2.0.3