on master help sign in
Separate module for main function
8edbde4Jasper Van der Jeugt
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 @@
1{-# LANGUAGE BangPatterns, FlexibleInstances, OverloadedStrings,
1{-# LANGUAGE BangPatterns, FlexibleInstances, OverloadedStrings,
2 ScopedTypeVariables, TypeSynonymInstances, CPP #-}
2 ScopedTypeVariables, TypeSynonymInstances, CPP #-}
3{-# OPTIONS_GHC -fno-enable-rewrite-rules #-}
3{-# OPTIONS_GHC -fno-enable-rewrite-rules #-}
4+module Data.Text.Tests.Properties
5+ (
6+ tests
7+ ) where
4
8
5import Test.QuickCheck
9import Test.QuickCheck
6import Test.QuickCheck.Monadic
10import Test.QuickCheck.Monadic
@@ -820,9 +824,6 @@ shorten n t@(S.Stream arr off len)
820 | n > 0 = S.Stream arr off (smaller (exactSize n) len)
824 | n > 0 = S.Stream arr off (smaller (exactSize n) len)
821 | otherwise = t
825 | otherwise = t
822
826
823−main :: IO ()
824−main = defaultMain tests
825−
826tests :: [Test]
827tests :: [Test]
827tests = [
828tests = [
828 testGroup "creation/elimination" [
829 testGroup "creation/elimination" [
tests/tests/text-tests.cabal+10−1
@@ -15,9 +15,13 @@ build-type: Simple
15
15
16cabal-version: >=1.2
16cabal-version: >=1.2
17
17
18+flag hpc
19+ description: Enable HPC to generate coverage reports
20+ default: False
21+
18executable text-tests
22executable text-tests
19 hs-source-dirs: src ../..
23 hs-source-dirs: src ../..
20− main-is: Data/Text/Tests/Properties.hs
24+ main-is: Data/Text/Tests.hs
21
25
22 ghc-options:
26 ghc-options:
23 -Wall
27 -Wall
@@ -26,6 +30,11 @@ executable text-tests
26 -fno-warn-orphans
30 -fno-warn-orphans
27 -fno-warn-missing-signatures
31 -fno-warn-missing-signatures
28
32
33+ -- Optional HPC support
34+ if flag(hpc)
35+ ghc-options:
36+ -fhpc
37+
29 cpp-options:
38 cpp-options:
30 -DASSERTS
39 -DASSERTS
31 -DHAVE_DEEPSEQ
40 -DHAVE_DEEPSEQ