[commit: containers] master: Improvements of test-suites compilation. (2898366)
Ian Lynagh
igloo at earth.li
Thu Feb 23 01:15:25 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/containers
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/289836681b7dd49ff3924cb311570cf22825cd7c
>---------------------------------------------------------------
commit 289836681b7dd49ff3924cb311570cf22825cd7c
Author: Milan Straka <fox at ucw.cz>
Date: Wed Nov 30 22:20:23 2011 +0100
Improvements of test-suites compilation.
Previously the test-suites could be compiled only when a special
testing version of the library was built using -ftesting flag.
As commented by Duncan, that is bad -- users which enable testing
by default would install the testing version of library.
Now the test-suites do not link against the whole containers,
but compiles the necessary modules separately, with special testing
flags.
>---------------------------------------------------------------
containers.cabal | 74 ++++++++++++++++++++++++++++++++---------------------
1 files changed, 45 insertions(+), 29 deletions(-)
diff --git a/containers.cabal b/containers.cabal
index 55a51e2..4453f9b 100644
--- a/containers.cabal
+++ b/containers.cabal
@@ -19,10 +19,6 @@ source-repository head
type: git
location: http://github.com/haskell/containers.git
-flag testing
- description: Expose internals for testing (required for cabal test)
- default: False
-
Library
build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3
if impl(ghc>=6.10)
@@ -54,17 +50,27 @@ Library
if impl(ghc<7.0)
extensions: MagicHash, DeriveDataTypeable, StandaloneDeriving, Rank2Types
- if flag(testing)
- cpp-options: -DTESTING
+-------------------
+-- T E S T I N G --
+-------------------
+
+-- Every test-suite contains the build-depends and options of the library,
+-- plus the testing stuff.
+
+-- Testing works for GHC >= 7.0. Test-suites could be modified to compile
+-- with GHC < 7.0, but we don't really care, as GHC < 7.0 is bundled with
+-- Cabal 1.8.* anyway.
Test-suite map-lazy-properties
- hs-source-dirs: tests
+ hs-source-dirs: tests, .
main-is: map-properties.hs
type: exitcode-stdio-1.0
+ cpp-options: -DTESTING
+
+ build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3, ghc-prim
+ ghc-options: -O2
build-depends:
- base,
- containers,
HUnit,
QuickCheck,
test-framework,
@@ -72,40 +78,45 @@ Test-suite map-lazy-properties
test-framework-quickcheck2
Test-suite map-strict-properties
- hs-source-dirs: tests
+ hs-source-dirs: tests, .
main-is: map-properties.hs
type: exitcode-stdio-1.0
+ cpp-options: -DTESTING -DSTRICT
+
+ build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3, ghc-prim
+ ghc-options: -O2
build-depends:
- base,
- containers,
HUnit,
QuickCheck,
test-framework,
test-framework-hunit,
test-framework-quickcheck2
- cpp-options: -DSTRICT
Test-suite set-properties
- hs-source-dirs: tests
+ hs-source-dirs: tests, .
main-is: set-properties.hs
type: exitcode-stdio-1.0
+ cpp-options: -DTESTING
+
+ build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3, ghc-prim
+ ghc-options: -O2
build-depends:
- base,
- containers,
QuickCheck,
test-framework,
test-framework-quickcheck2
Test-suite intmap-lazy-properties
- hs-source-dirs: tests
+ hs-source-dirs: tests, .
main-is: intmap-properties.hs
type: exitcode-stdio-1.0
+ cpp-options: -DTESTING
+
+ build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3, ghc-prim
+ ghc-options: -O2
build-depends:
- base,
- containers,
HUnit,
QuickCheck,
test-framework,
@@ -113,40 +124,45 @@ Test-suite intmap-lazy-properties
test-framework-quickcheck2
Test-suite intmap-strict-properties
- hs-source-dirs: tests
+ hs-source-dirs: tests, .
main-is: intmap-properties.hs
type: exitcode-stdio-1.0
+ cpp-options: -DTESTING -DSTRICT
+
+ build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3, ghc-prim
+ ghc-options: -O2
build-depends:
- base,
- containers,
HUnit,
QuickCheck,
test-framework,
test-framework-hunit,
test-framework-quickcheck2
- cpp-options: -DSTRICT
Test-suite intset-properties
- hs-source-dirs: tests
+ hs-source-dirs: tests, .
main-is: intset-properties.hs
type: exitcode-stdio-1.0
+ cpp-options: -DTESTING
+
+ build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3, ghc-prim
+ ghc-options: -O2
build-depends:
- base,
- containers,
QuickCheck,
test-framework,
test-framework-quickcheck2
Test-suite seq-properties
- hs-source-dirs: tests
+ hs-source-dirs: tests, .
main-is: seq-properties.hs
type: exitcode-stdio-1.0
+ cpp-options: -DTESTING
+
+ build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3, ghc-prim
+ ghc-options: -O2
build-depends:
- base,
- containers,
QuickCheck,
test-framework,
test-framework-quickcheck2
More information about the Cvs-libraries
mailing list