While developers usually run tests and hence need all the infrastructure for it, people who just want to build and use Ganeti usually do not want to run tests. So, while still using cabal to get a consistent set of dependency packages, make the test infra structure optional in the cabal file. The decision on whether to require test dependencies will be made based on whether the haskell tests are configured to be run.
Signed-off-by: Klaus Aehlig <[email protected]> --- Makefile.am | 1 + cabal/ganeti.template.cabal | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9c44e6c..5f7e765 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1351,6 +1351,7 @@ $(HASKELL_PACKAGE_VERSIONS_FILE): Makefile ganeti.cabal \ cabal/CabalDependenciesMacros.hs touch empty-cabal-config $(CABAL) --config-file=empty-cabal-config configure --user \ + -f`test $(HTEST) == yes && echo "htest" || echo "-htest"` \ -f`test $(ENABLE_MOND) == True && echo "mond" || echo "-mond"` \ -f`test $(ENABLE_METADATA) == True && echo "metad" || echo "-metad"` runhaskell $(abs_top_srcdir)/cabal/CabalDependenciesMacros.hs \ diff --git a/cabal/ganeti.template.cabal b/cabal/ganeti.template.cabal index b1b41d1..3813087 100644 --- a/cabal/ganeti.template.cabal +++ b/cabal/ganeti.template.cabal @@ -5,7 +5,7 @@ license: BSD2 license-file: COPYING author: Google Inc. maintainer: [email protected] -copyright: 2006-2014 Google Inc. +copyright: 2006-2015 Google Inc. category: System build-type: Simple extra-source-files: README @@ -25,6 +25,10 @@ flag metad description: enable the ganeti metadata daemon default: True +flag htest + description: enable tests + default: True + library exposed-modules: @@ -69,17 +73,19 @@ library , utf8-string >= 0.3.7 && < 0.4 , zlib >= 0.5.3.3 && < 0.6 - , HUnit >= 1.2.4.2 && < 1.3 - , QuickCheck >= 2.4.2 && < 2.8 - , test-framework >= 0.6 && < 0.9 - , test-framework-hunit >= 0.2.7 && < 0.4 - , test-framework-quickcheck2 >= 0.2.12.1 && < 0.4 - -- Executables: -- , happy -- , hscolour -- , shelltestrunner + if flag(htest) + build-depends: + HUnit >= 1.2.4.2 && < 1.3 + , QuickCheck >= 2.4.2 && < 2.8 + , test-framework >= 0.6 && < 0.9 + , test-framework-hunit >= 0.2.7 && < 0.4 + , test-framework-quickcheck2 >= 0.2.12.1 && < 0.4 + if flag(mond) build-depends: PSQueue >= 1.1 && < 1.2 -- 2.5.0.rc2.392.g76e840b
