Commit 55ea687a authored by Oleg Grenrus's avatar Oleg Grenrus

Add -Wunused-packages, cleanup warnings

parent 45bdec1e
......@@ -139,6 +139,9 @@ executable cabal
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
ghc-options: -rtsopts -threaded
......@@ -349,7 +352,6 @@ executable cabal
HTTP >= 4000.1.5 && < 4000.4,
mtl >= 2.0 && < 2.3,
network-uri >= 2.6.0.2 && < 2.7,
network >= 2.6 && < 3.2,
pretty >= 1.1 && < 1.2,
process >= 1.2.3.0 && < 1.7,
random >= 1 && < 1.2,
......
......@@ -137,6 +137,9 @@ library cabal-lib-client
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
hs-source-dirs: .
exposed-modules:
-- this modules are moved from Cabal
......@@ -343,7 +346,6 @@ library cabal-lib-client
HTTP >= 4000.1.5 && < 4000.4,
mtl >= 2.0 && < 2.3,
network-uri >= 2.6.0.2 && < 2.7,
network >= 2.6 && < 3.2,
pretty >= 1.1 && < 1.2,
process >= 1.2.3.0 && < 1.7,
random >= 1 && < 1.2,
......@@ -399,6 +401,9 @@ library cabal-install-solver-dsl
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
hs-source-dirs: solver-dsl
exposed-modules:
UnitTests.Distribution.Solver.Modular.DSL
......@@ -419,6 +424,9 @@ executable cabal
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
ghc-options: -rtsopts -threaded
......@@ -436,10 +444,21 @@ executable cabal
-- Small, fast running tests.
--
Test-Suite unit-tests
default-language: Haskell2010
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
if impl(ghc >= 8.0)
ghc-options: -Wcompat
-Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
ghc-options: -threaded
type: exitcode-stdio-1.0
main-is: UnitTests.hs
hs-source-dirs: tests
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -main-is UnitTests
other-modules:
UnitTests.Distribution.Client.ArbitraryInstances
UnitTests.Distribution.Client.BuildReport
......@@ -470,7 +489,6 @@ Test-Suite unit-tests
build-depends:
array,
base,
async,
bytestring,
cabal-lib-client,
cabal-install-solver-dsl,
......@@ -479,7 +497,6 @@ Test-Suite unit-tests
Cabal-tree-diff,
Cabal-QuickCheck,
containers,
deepseq,
mtl,
random,
directory,
......@@ -488,64 +505,71 @@ Test-Suite unit-tests
time,
zlib,
network-uri >= 2.6.2.0 && <2.6.4.0,
network,
tasty >= 1.2.3 && <1.4,
tasty-golden >=2.3.1.1 && <2.4,
tasty-hunit >= 0.10,
tasty-quickcheck,
tagged,
tree-diff,
QuickCheck >= 2.14 && <2.15
ghc-options: -threaded
default-language: Haskell2010
-- Tests to run with a limited stack and heap size
--
Test-Suite memory-usage-tests
default-language: Haskell2010
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
if impl(ghc >= 8.0)
ghc-options: -Wcompat
-Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
ghc-options: -threaded
ghc-options: "-with-rtsopts=-M4M -K1K"
type: exitcode-stdio-1.0
main-is: MemoryUsageTests.hs
hs-source-dirs: tests
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns "-with-rtsopts=-M4M -K1K" -main-is MemoryUsageTests
other-modules:
UnitTests.Distribution.Solver.Modular.DSL.TestCaseUtils
UnitTests.Distribution.Solver.Modular.MemoryUsage
UnitTests.Options
build-depends:
base,
async,
Cabal,
cabal-lib-client,
cabal-install-solver-dsl,
containers,
deepseq,
tagged,
tasty >= 1.2.3 && <1.4,
tasty-hunit >= 0.10
ghc-options: -threaded
default-language: Haskell2010
-- Slow solver tests
--
Test-Suite solver-quickcheck
default-language: Haskell2010
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
if impl(ghc >= 8.0)
ghc-options: -Wcompat
-Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
ghc-options: -threaded
type: exitcode-stdio-1.0
main-is: SolverQuickCheck.hs
hs-source-dirs: tests
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -main-is SolverQuickCheck
other-modules:
UnitTests.Distribution.Solver.Modular.QuickCheck
UnitTests.Distribution.Solver.Modular.QuickCheck.Utils
build-depends:
base,
async,
Cabal,
Cabal-QuickCheck,
cabal-lib-client,
cabal-install-solver-dsl,
containers,
deepseq >= 1.2,
hashable,
random,
......@@ -555,18 +579,24 @@ Test-Suite solver-quickcheck
QuickCheck >= 2.14 && <2.15,
pretty-show >= 1.6.15
ghc-options: -threaded
default-language: Haskell2010
-- Integration tests that use the cabal-install code directly
-- but still build whole projects
test-suite integration-tests2
default-language: Haskell2010
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
if impl(ghc >= 8.0)
ghc-options: -Wcompat
-Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
ghc-options: -threaded
type: exitcode-stdio-1.0
main-is: IntegrationTests2.hs
hs-source-dirs: tests
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -main-is IntegrationTests2
other-modules:
build-depends:
base,
......@@ -574,14 +604,10 @@ test-suite integration-tests2
Cabal,
cabal-lib-client,
containers,
deepseq,
directory,
edit-distance,
filepath,
tasty >= 1.2.3 && <1.4,
tasty-hunit >= 0.10,
tagged
ghc-options: -threaded
default-language: Haskell2010
......@@ -139,6 +139,9 @@ executable cabal
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
ghc-options: -rtsopts -threaded
......@@ -349,7 +352,6 @@ executable cabal
HTTP >= 4000.1.5 && < 4000.4,
mtl >= 2.0 && < 2.3,
network-uri >= 2.6.0.2 && < 2.7,
network >= 2.6 && < 3.2,
pretty >= 1.1 && < 1.2,
process >= 1.2.3.0 && < 1.7,
random >= 1 && < 1.2,
......
......@@ -31,7 +31,6 @@ Version: 3.4.0.0
HTTP >= 4000.1.5 && < 4000.4,
mtl >= 2.0 && < 2.3,
network-uri >= 2.6.0.2 && < 2.7,
network >= 2.6 && < 3.2,
pretty >= 1.1 && < 1.2,
process >= 1.2.3.0 && < 1.7,
random >= 1 && < 1.2,
......@@ -76,6 +75,9 @@ Version: 3.4.0.0
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if impl(ghc >=8.10)
ghc-options: -Wunused-packages
{% endblock %}
{% defblock buildInfo %}
{% if dev %}
......@@ -464,10 +466,11 @@ executable cabal
-- Small, fast running tests.
--
Test-Suite unit-tests
{% useblock componentCommon %}
ghc-options: -threaded
type: exitcode-stdio-1.0
main-is: UnitTests.hs
hs-source-dirs: tests
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -main-is UnitTests
other-modules:
UnitTests.Distribution.Client.ArbitraryInstances
UnitTests.Distribution.Client.BuildReport
......@@ -498,7 +501,6 @@ Test-Suite unit-tests
build-depends:
array,
base,
async,
bytestring,
cabal-lib-client,
cabal-install-solver-dsl,
......@@ -507,7 +509,6 @@ Test-Suite unit-tests
Cabal-tree-diff,
Cabal-QuickCheck,
containers,
deepseq,
mtl,
random,
directory,
......@@ -516,64 +517,51 @@ Test-Suite unit-tests
time,
zlib,
network-uri >= 2.6.2.0 && <2.6.4.0,
network,
tasty >= 1.2.3 && <1.4,
tasty-golden >=2.3.1.1 && <2.4,
tasty-hunit >= 0.10,
tasty-quickcheck,
tagged,
tree-diff,
QuickCheck >= 2.14 && <2.15
ghc-options: -threaded
default-language: Haskell2010
-- Tests to run with a limited stack and heap size
--
Test-Suite memory-usage-tests
{% useblock componentCommon %}
ghc-options: -threaded
ghc-options: "-with-rtsopts=-M4M -K1K"
type: exitcode-stdio-1.0
main-is: MemoryUsageTests.hs
hs-source-dirs: tests
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns "-with-rtsopts=-M4M -K1K" -main-is MemoryUsageTests
other-modules:
UnitTests.Distribution.Solver.Modular.DSL.TestCaseUtils
UnitTests.Distribution.Solver.Modular.MemoryUsage
UnitTests.Options
build-depends:
base,
async,
Cabal,
cabal-lib-client,
cabal-install-solver-dsl,
containers,
deepseq,
tagged,
tasty >= 1.2.3 && <1.4,
tasty-hunit >= 0.10
ghc-options: -threaded
default-language: Haskell2010
-- Slow solver tests
--
Test-Suite solver-quickcheck
{% useblock componentCommon %}
ghc-options: -threaded
type: exitcode-stdio-1.0
main-is: SolverQuickCheck.hs
hs-source-dirs: tests
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -main-is SolverQuickCheck
other-modules:
UnitTests.Distribution.Solver.Modular.QuickCheck
UnitTests.Distribution.Solver.Modular.QuickCheck.Utils
build-depends:
base,
async,
Cabal,
Cabal-QuickCheck,
cabal-lib-client,
cabal-install-solver-dsl,
containers,
deepseq >= 1.2,
hashable,
random,
......@@ -583,18 +571,14 @@ Test-Suite solver-quickcheck
QuickCheck >= 2.14 && <2.15,
pretty-show >= 1.6.15
ghc-options: -threaded
default-language: Haskell2010
-- Integration tests that use the cabal-install code directly
-- but still build whole projects
test-suite integration-tests2
{% useblock componentCommon %}
ghc-options: -threaded
type: exitcode-stdio-1.0
main-is: IntegrationTests2.hs
hs-source-dirs: tests
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -main-is IntegrationTests2
other-modules:
build-depends:
base,
......@@ -602,15 +586,11 @@ test-suite integration-tests2
Cabal,
cabal-lib-client,
containers,
deepseq,
directory,
edit-distance,
filepath,
tasty >= 1.2.3 && <1.4,
tasty-hunit >= 0.10,
tagged
ghc-options: -threaded
default-language: Haskell2010
{% endif %}
......@@ -8,7 +8,7 @@
-- For the handy instance IsString PackageIdentifier
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IntegrationTests2 where
module Main where
import Distribution.Client.Compat.Prelude
import Prelude ()
......
module MemoryUsageTests where
module Main where
import Test.Tasty
......
module SolverQuickCheck where
module Main where
import Test.Tasty
......
{-# LANGUAGE ScopedTypeVariables #-}
module UnitTests where
module Main where
import Test.Tasty
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment