on master help sign in
Separate module for main function
commit8edbde491b4547f6d5eb1241f626b8b8cc8b2b0c authorJasper Van der Jeugt <jaspervdj@gmail.com> dateTue 21 Jun 2011, 10:55 (15 years ago) parent2ecd034
4 files changed+27−4
tests/tests/.ghci+1 tests/tests/src/Data/Text/Tests.hs+12 tests/tests/src/Data/Text/Tests/Properties.hs+4−3 tests/tests/text-tests.cabal+10−1
tests/tests/.ghcinew file+1
@@ -0,0 +1 @@
1+:set -DHAVE_DEEPSEQ -isrc -i../..
tests/tests/src/Data/Text/Tests.hsnew file+12
@@ -0,0 +1,12 @@
1+-- | Provides a simple main function which runs all the tests
2+--
3+module Main
4+ ( main
5+ ) where
6+
7+import Test.Framework (defaultMain)
8+
9+import Data.Text.Tests.Properties (tests)
10+
11+main :: IO ()
12+main = defaultMain tests
tests/tests/src/Data/Text/Tests/Properties.hs+4−3
@@ -1,6 +1,10 @@
11{-# LANGUAGE BangPatterns, FlexibleInstances, OverloadedStrings,
22 ScopedTypeVariables, TypeSynonymInstances, CPP #-}
33{-# OPTIONS_GHC -fno-enable-rewrite-rules #-}
4+module Data.Text.Tests.Properties
5+ (
6+ tests
7+ ) where
48
59import Test.QuickCheck
610import Test.QuickCheck.Monadic
@@ -820,9 +824,6 @@ shorten n t@(S.Stream arr off len)
820824 | n > 0 = S.Stream arr off (smaller (exactSize n) len)
821825 | otherwise = t
822826
823−main :: IO ()
824−main = defaultMain tests
825−
826827tests :: [Test]
827828tests = [
828829 testGroup "creation/elimination" [
tests/tests/text-tests.cabal+10−1
@@ -15,9 +15,13 @@ build-type: Simple
1515
1616cabal-version: >=1.2
1717
18+flag hpc
19+ description: Enable HPC to generate coverage reports
20+ default: False
21+
1822executable text-tests
1923 hs-source-dirs: src ../..
20− main-is: Data/Text/Tests/Properties.hs
24+ main-is: Data/Text/Tests.hs
2125
2226 ghc-options:
2327 -Wall
@@ -26,6 +30,11 @@ executable text-tests
2630 -fno-warn-orphans
2731 -fno-warn-missing-signatures
2832
33+ -- Optional HPC support
34+ if flag(hpc)
35+ ghc-options:
36+ -fhpc
37+
2938 cpp-options:
3039 -DASSERTS
3140 -DHAVE_DEEPSEQ