X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=test%2FTestSuite.hs;h=69bae3c80c9de6734ccc041789d83285799b4932;hb=942b8ef3bc5830ca0defa62342d55550aea59934;hp=d7cc5fffe7b60141d3d17090820d4bb50336dfb4;hpb=9200fe5fcab505e5a331514a6ee687c6f78011b1;p=hath.git diff --git a/test/TestSuite.hs b/test/TestSuite.hs index d7cc5ff..69bae3c 100644 --- a/test/TestSuite.hs +++ b/test/TestSuite.hs @@ -1,32 +1,38 @@ {-# LANGUAGE NoMonomorphismRestriction #-} -import Test.HUnit -import Test.QuickCheck (Args(..), quickCheckWith, stdArgs) +import Data.Monoid (mempty) +import Test.Framework ( + Test, + defaultMainWithOpts, + ) +import Test.Framework.Options +import Test.Framework.Runners.Options -import Cidr (cidr_tests, - prop_all_cidrs_contain_themselves, - prop_contains_proper_intransitive) +import Cidr (cidr_properties, cidr_tests) -import IPv4Address (ipv4address_tests) +import IPv4Address (ipv4address_properties, ipv4address_tests) import Octet (octet_tests) --- The list of HUnit tests. -test_suite = TestList (concat [cidr_tests, - ipv4address_tests, - octet_tests]) +tests :: [Test.Framework.Test] +tests = [ cidr_properties, + cidr_tests, + ipv4address_properties, + ipv4address_tests, + octet_tests ] main :: IO () main = do - putStrLn "HUnit" - putStrLn "-----" - runTestTT test_suite + let empty_test_opts = mempty :: TestOptions + let my_test_opts = empty_test_opts { + -- + -- Increase to 5000 when, + -- https://github.com/batterseapower/test-framework/issues/34 + -- is fixed. + -- + topt_maximum_generated_tests = Just 1000 + } + let empty_runner_opts = mempty :: RunnerOptions + let my_runner_opts = empty_runner_opts { + ropt_test_options = Just my_test_opts + } - putStrLn "" - - putStrLn "QuickCheck" - putStrLn "----------" - qc prop_all_cidrs_contain_themselves - qc prop_contains_proper_intransitive - where - args :: Args - args = stdArgs { maxDiscard = 5000 } - qc = quickCheckWith args + defaultMainWithOpts tests my_runner_opts