Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch to use HTF for managing tests.

  • Loading branch information...
commit d77801bbeeb171475831f00e6cf361288670ba58 1 parent aea7eec
@magthe authored
Showing with 20 additions and 26 deletions.
  1. +6 −5 hsini.cabal
  2. +4 −21 tst/{IniTest.hs → Ini.hs}
  3. +10 −0 tst/Main.hs
View
11 hsini.cabal
@@ -9,7 +9,7 @@ synopsis : Package for user configuration files (INI)
description : None yet
build-type : Simple
category : Network
-cabal-version : >= 1.2
+cabal-version : >= 1.6
flag Test
description : Enable building of tests
@@ -17,15 +17,16 @@ flag Test
library
hs-source-dirs : src
- build-depends : base, containers, parsec >=2.1 && <2.2, monads-fd
+ build-depends : base, containers, parsec ==2.1.*, monads-fd
exposed-modules : Data.Ini Data.Ini.Types Data.Ini.Reader
other-modules : Data.Ini.Reader.Internals
-Executable initest
- main-is : IniTest.hs
+Executable test
+ main-is : Main.hs
hs-source-dirs : tst, src
+ other-modules : Ini
if flag(Test)
- build-depends : smallcheck
+ build-depends : HTF
buildable : True
ghc-options : -fhpc
else
View
25 tst/IniTest.hs → tst/Ini.hs
@@ -1,9 +1,10 @@
-{-# LANGUAGE ExistentialQuantification #-}
-module Main where
+{-# OPTIONS_GHC -F -pgmF htfpp #-}
+
+module Ini where
-- {{{1 imports
-import Test.SmallCheck
import Data.Maybe
+import Test.Framework
import Data.Ini
import Data.Ini.Types
@@ -51,21 +52,3 @@ prop_optDelGet sn on ov cfglst = isNothing $ getOption sn on $ delOption sn on c
where
cfg = cfgFromList cfglst
cfg2 = setOption sn on ov cfg
-
--- {{{1 top-level functions
-data TB = forall a. Testable a => TB a
-
-allProps =
- [ (3, TB prop_secAddDel)
- , (3, TB prop_secAddHas)
- , (3, TB prop_secAddGet)
- , (3, TB prop_secDelGet)
- , (2, TB prop_optSetDel)
- , (2, TB prop_optSetHas)
- , (2, TB prop_optSetGet)
- , (2, TB prop_optDelGet)
- ]
-
-main = mapM_ sC allProps
- where
- sC (i, TB f) = smallCheck i f
View
10 tst/Main.hs
@@ -0,0 +1,10 @@
+module Main where
+
+import System.Environment ( getArgs )
+import Test.Framework
+
+import qualified Ini as I
+
+main = do
+ args <- getArgs
+ runTestWithArgs args I.allHTFTests
Please sign in to comment.
Something went wrong with that request. Please try again.