Remove use of defaultMainWithOpts from test suite
authorJohan Tibell <johan.tibell@gmail.com>
Thu, 20 Sep 2012 09:20:05 +0000 (11:20 +0200)
committerJohan Tibell <johan.tibell@gmail.com>
Thu, 20 Sep 2012 09:24:24 +0000 (11:24 +0200)
defaultMainWithOpts doesn't allow us to pass additional flags, such as
--jxml, on the command line. The old behavior (i.e. setting the number
of tests) can still be achieved like so:

cabal test --test-option=-a500 \
  --test-option=--maximum-unsuitable-generated-tests=500

tests/intmap-properties.hs
tests/intset-properties.hs
tests/map-properties.hs
tests/seq-properties.hs
tests/set-properties.hs

index a5decbe..6bf7ac5 100644 (file)
@@ -27,7 +27,7 @@ import Text.Show.Functions ()
 default (Int)
 
 main :: IO ()
-main = defaultMainWithOpts
+main = defaultMain
          [
                testCase "index"      test_index
              , testCase "size"       test_size
@@ -166,13 +166,7 @@ main = defaultMainWithOpts
              , testProperty "foldl'"               prop_foldl'
              , testProperty "keysSet"              prop_keysSet
              , testProperty "fromSet"              prop_fromSet
-             ] opts
-
-  where
-    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
-                                                      , topt_maximum_unsuitable_generated_tests = Just 500
-                                                      }
-                  }
+             ]
 
 {--------------------------------------------------------------------
   Arbitrary, reasonably balanced trees
index 1a97654..e424ee9 100644 (file)
@@ -18,62 +18,57 @@ import Test.HUnit hiding (Test, Testable)
 import Test.QuickCheck hiding ((.&.))
 
 main :: IO ()
-main = defaultMainWithOpts [ testCase "lookupLT" test_lookupLT
-                           , testCase "lookupGT" test_lookupGT
-                           , testCase "lookupLE" test_lookupLE
-                           , testCase "lookupGE" test_lookupGE
-                           , testCase "split" test_split
-                           , testProperty "prop_Single" prop_Single
-                           , testProperty "prop_Member" prop_Member
-                           , testProperty "prop_NotMember" prop_NotMember
-                           , testProperty "prop_LookupLT" prop_LookupLT
-                           , testProperty "prop_LookupGT" prop_LookupGT
-                           , testProperty "prop_LookupLE" prop_LookupLE
-                           , testProperty "prop_LookupGE" prop_LookupGE
-                           , testProperty "prop_InsertDelete" prop_InsertDelete
-                           , testProperty "prop_MemberFromList" prop_MemberFromList
-                           , testProperty "prop_UnionInsert" prop_UnionInsert
-                           , testProperty "prop_UnionAssoc" prop_UnionAssoc
-                           , testProperty "prop_UnionComm" prop_UnionComm
-                           , testProperty "prop_Diff" prop_Diff
-                           , testProperty "prop_Int" prop_Int
-                           , testProperty "prop_Ordered" prop_Ordered
-                           , testProperty "prop_List" prop_List
-                           , testProperty "prop_DescList" prop_DescList
-                           , testProperty "prop_AscDescList" prop_AscDescList
-                           , testProperty "prop_fromList" prop_fromList
-                           , testProperty "prop_MaskPow2" prop_MaskPow2
-                           , testProperty "prop_Prefix" prop_Prefix
-                           , testProperty "prop_LeftRight" prop_LeftRight
-                           , testProperty "prop_isProperSubsetOf" prop_isProperSubsetOf
-                           , testProperty "prop_isProperSubsetOf2" prop_isProperSubsetOf2
-                           , testProperty "prop_isSubsetOf" prop_isSubsetOf
-                           , testProperty "prop_isSubsetOf2" prop_isSubsetOf2
-                           , testProperty "prop_size" prop_size
-                           , testProperty "prop_findMax" prop_findMax
-                           , testProperty "prop_findMin" prop_findMin
-                           , testProperty "prop_ord" prop_ord
-                           , testProperty "prop_readShow" prop_readShow
-                           , testProperty "prop_foldR" prop_foldR
-                           , testProperty "prop_foldR'" prop_foldR'
-                           , testProperty "prop_foldL" prop_foldL
-                           , testProperty "prop_foldL'" prop_foldL'
-                           , testProperty "prop_map" prop_map
-                           , testProperty "prop_maxView" prop_maxView
-                           , testProperty "prop_minView" prop_minView
-                           , testProperty "prop_split" prop_split
-                           , testProperty "prop_splitMember" prop_splitMember
-                           , testProperty "prop_partition" prop_partition
-                           , testProperty "prop_filter" prop_filter
+main = defaultMain [ testCase "lookupLT" test_lookupLT
+                   , testCase "lookupGT" test_lookupGT
+                   , testCase "lookupLE" test_lookupLE
+                   , testCase "lookupGE" test_lookupGE
+                   , testCase "split" test_split
+                   , testProperty "prop_Single" prop_Single
+                   , testProperty "prop_Member" prop_Member
+                   , testProperty "prop_NotMember" prop_NotMember
+                   , testProperty "prop_LookupLT" prop_LookupLT
+                   , testProperty "prop_LookupGT" prop_LookupGT
+                   , testProperty "prop_LookupLE" prop_LookupLE
+                   , testProperty "prop_LookupGE" prop_LookupGE
+                   , testProperty "prop_InsertDelete" prop_InsertDelete
+                   , testProperty "prop_MemberFromList" prop_MemberFromList
+                   , testProperty "prop_UnionInsert" prop_UnionInsert
+                   , testProperty "prop_UnionAssoc" prop_UnionAssoc
+                   , testProperty "prop_UnionComm" prop_UnionComm
+                   , testProperty "prop_Diff" prop_Diff
+                   , testProperty "prop_Int" prop_Int
+                   , testProperty "prop_Ordered" prop_Ordered
+                   , testProperty "prop_List" prop_List
+                   , testProperty "prop_DescList" prop_DescList
+                   , testProperty "prop_AscDescList" prop_AscDescList
+                   , testProperty "prop_fromList" prop_fromList
+                   , testProperty "prop_MaskPow2" prop_MaskPow2
+                   , testProperty "prop_Prefix" prop_Prefix
+                   , testProperty "prop_LeftRight" prop_LeftRight
+                   , testProperty "prop_isProperSubsetOf" prop_isProperSubsetOf
+                   , testProperty "prop_isProperSubsetOf2" prop_isProperSubsetOf2
+                   , testProperty "prop_isSubsetOf" prop_isSubsetOf
+                   , testProperty "prop_isSubsetOf2" prop_isSubsetOf2
+                   , testProperty "prop_size" prop_size
+                   , testProperty "prop_findMax" prop_findMax
+                   , testProperty "prop_findMin" prop_findMin
+                   , testProperty "prop_ord" prop_ord
+                   , testProperty "prop_readShow" prop_readShow
+                   , testProperty "prop_foldR" prop_foldR
+                   , testProperty "prop_foldR'" prop_foldR'
+                   , testProperty "prop_foldL" prop_foldL
+                   , testProperty "prop_foldL'" prop_foldL'
+                   , testProperty "prop_map" prop_map
+                   , testProperty "prop_maxView" prop_maxView
+                   , testProperty "prop_minView" prop_minView
+                   , testProperty "prop_split" prop_split
+                   , testProperty "prop_splitMember" prop_splitMember
+                   , testProperty "prop_partition" prop_partition
+                   , testProperty "prop_filter" prop_filter
 #if MIN_VERSION_base(4,5,0)
-                           , testProperty "prop_bitcount" prop_bitcount
+                   , testProperty "prop_bitcount" prop_bitcount
 #endif
-                           ] opts
-  where
-    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
-                                                      , topt_maximum_unsuitable_generated_tests = Just 500
-                                                      }
-                  }
+                   ]
 
 ----------------------------------------------------------------
 -- Unit tests
index 9975b0e..8b9f14b 100644 (file)
@@ -27,7 +27,7 @@ import Text.Show.Functions ()
 default (Int)
 
 main :: IO ()
-main = defaultMainWithOpts
+main = defaultMain
          [ testCase "ticket4242" test_ticket4242
          , testCase "index"      test_index
          , testCase "size"       test_size
@@ -189,13 +189,7 @@ main = defaultMainWithOpts
          , testProperty "foldl'"               prop_foldl'
          , testProperty "keysSet"              prop_keysSet
          , testProperty "fromSet"              prop_fromSet
-         ] opts
-
-  where
-    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
-                                                      , topt_maximum_unsuitable_generated_tests = Just 500
-                                                      }
-                  }
+         ]
 
 {--------------------------------------------------------------------
   Arbitrary, reasonably balanced trees
index 48ceebf..74b2e9c 100644 (file)
@@ -21,7 +21,7 @@ import Test.Framework.Providers.QuickCheck2
 
 
 main :: IO ()
-main = defaultMainWithOpts
+main = defaultMain
        [ testProperty "fmap" prop_fmap
        , testProperty "(<$)" prop_constmap
        , testProperty "foldr" prop_foldr
@@ -90,13 +90,7 @@ main = defaultMainWithOpts
        , testProperty "zipWith3" prop_zipWith3
        , testProperty "zip4" prop_zip4
        , testProperty "zipWith4" prop_zipWith4
-       ] opts
-
-  where
-    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
-                                                      , topt_maximum_unsuitable_generated_tests = Just 500
-                                                      }
-                  }
+       ]
 
 ------------------------------------------------------------------------
 -- Arbitrary
index 5f4ebaf..08c6b20 100644 (file)
@@ -11,62 +11,57 @@ import Test.HUnit hiding (Test, Testable)
 import Test.QuickCheck
 
 main :: IO ()
-main = defaultMainWithOpts [ testCase "lookupLT" test_lookupLT
-                           , testCase "lookupGT" test_lookupGT
-                           , testCase "lookupLE" test_lookupLE
-                           , testCase "lookupGE" test_lookupGE
-                           , testProperty "prop_Valid" prop_Valid
-                           , testProperty "prop_Single" prop_Single
-                           , testProperty "prop_Member" prop_Member
-                           , testProperty "prop_NotMember" prop_NotMember
-                           , testProperty "prop_LookupLT" prop_LookupLT
-                           , testProperty "prop_LookupGT" prop_LookupGT
-                           , testProperty "prop_LookupLE" prop_LookupLE
-                           , testProperty "prop_LookupGE" prop_LookupGE
-                           , testProperty "prop_InsertValid" prop_InsertValid
-                           , testProperty "prop_InsertDelete" prop_InsertDelete
-                           , testProperty "prop_DeleteValid" prop_DeleteValid
-                           , testProperty "prop_Join" prop_Join
-                           , testProperty "prop_Merge" prop_Merge
-                           , testProperty "prop_UnionValid" prop_UnionValid
-                           , testProperty "prop_UnionInsert" prop_UnionInsert
-                           , testProperty "prop_UnionAssoc" prop_UnionAssoc
-                           , testProperty "prop_UnionComm" prop_UnionComm
-                           , testProperty "prop_DiffValid" prop_DiffValid
-                           , testProperty "prop_Diff" prop_Diff
-                           , testProperty "prop_IntValid" prop_IntValid
-                           , testProperty "prop_Int" prop_Int
-                           , testProperty "prop_Ordered" prop_Ordered
-                           , testProperty "prop_List" prop_List
-                           , testProperty "prop_DescList" prop_DescList
-                           , testProperty "prop_AscDescList" prop_AscDescList
-                           , testProperty "prop_fromList" prop_fromList
-                           , testProperty "prop_isProperSubsetOf" prop_isProperSubsetOf
-                           , testProperty "prop_isProperSubsetOf2" prop_isProperSubsetOf2
-                           , testProperty "prop_isSubsetOf" prop_isSubsetOf
-                           , testProperty "prop_isSubsetOf2" prop_isSubsetOf2
-                           , testProperty "prop_size" prop_size
-                           , testProperty "prop_findMax" prop_findMax
-                           , testProperty "prop_findMin" prop_findMin
-                           , testProperty "prop_ord" prop_ord
-                           , testProperty "prop_readShow" prop_readShow
-                           , testProperty "prop_foldR" prop_foldR
-                           , testProperty "prop_foldR'" prop_foldR'
-                           , testProperty "prop_foldL" prop_foldL
-                           , testProperty "prop_foldL'" prop_foldL'
-                           , testProperty "prop_map" prop_map
-                           , testProperty "prop_maxView" prop_maxView
-                           , testProperty "prop_minView" prop_minView
-                           , testProperty "prop_split" prop_split
-                           , testProperty "prop_splitMember" prop_splitMember
-                           , testProperty "prop_partition" prop_partition
-                           , testProperty "prop_filter" prop_filter
-                           ] opts
-  where
-    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
-                                                      , topt_maximum_unsuitable_generated_tests = Just 500
-                                                      }
-                  }
+main = defaultMain [ testCase "lookupLT" test_lookupLT
+                   , testCase "lookupGT" test_lookupGT
+                   , testCase "lookupLE" test_lookupLE
+                   , testCase "lookupGE" test_lookupGE
+                   , testProperty "prop_Valid" prop_Valid
+                   , testProperty "prop_Single" prop_Single
+                   , testProperty "prop_Member" prop_Member
+                   , testProperty "prop_NotMember" prop_NotMember
+                   , testProperty "prop_LookupLT" prop_LookupLT
+                   , testProperty "prop_LookupGT" prop_LookupGT
+                   , testProperty "prop_LookupLE" prop_LookupLE
+                   , testProperty "prop_LookupGE" prop_LookupGE
+                   , testProperty "prop_InsertValid" prop_InsertValid
+                   , testProperty "prop_InsertDelete" prop_InsertDelete
+                   , testProperty "prop_DeleteValid" prop_DeleteValid
+                   , testProperty "prop_Join" prop_Join
+                   , testProperty "prop_Merge" prop_Merge
+                   , testProperty "prop_UnionValid" prop_UnionValid
+                   , testProperty "prop_UnionInsert" prop_UnionInsert
+                   , testProperty "prop_UnionAssoc" prop_UnionAssoc
+                   , testProperty "prop_UnionComm" prop_UnionComm
+                   , testProperty "prop_DiffValid" prop_DiffValid
+                   , testProperty "prop_Diff" prop_Diff
+                   , testProperty "prop_IntValid" prop_IntValid
+                   , testProperty "prop_Int" prop_Int
+                   , testProperty "prop_Ordered" prop_Ordered
+                   , testProperty "prop_List" prop_List
+                   , testProperty "prop_DescList" prop_DescList
+                   , testProperty "prop_AscDescList" prop_AscDescList
+                   , testProperty "prop_fromList" prop_fromList
+                   , testProperty "prop_isProperSubsetOf" prop_isProperSubsetOf
+                   , testProperty "prop_isProperSubsetOf2" prop_isProperSubsetOf2
+                   , testProperty "prop_isSubsetOf" prop_isSubsetOf
+                   , testProperty "prop_isSubsetOf2" prop_isSubsetOf2
+                   , testProperty "prop_size" prop_size
+                   , testProperty "prop_findMax" prop_findMax
+                   , testProperty "prop_findMin" prop_findMin
+                   , testProperty "prop_ord" prop_ord
+                   , testProperty "prop_readShow" prop_readShow
+                   , testProperty "prop_foldR" prop_foldR
+                   , testProperty "prop_foldR'" prop_foldR'
+                   , testProperty "prop_foldL" prop_foldL
+                   , testProperty "prop_foldL'" prop_foldL'
+                   , testProperty "prop_map" prop_map
+                   , testProperty "prop_maxView" prop_maxView
+                   , testProperty "prop_minView" prop_minView
+                   , testProperty "prop_split" prop_split
+                   , testProperty "prop_splitMember" prop_splitMember
+                   , testProperty "prop_partition" prop_partition
+                   , testProperty "prop_filter" prop_filter
+                   ]
 
 ----------------------------------------------------------------
 -- Unit tests