X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=test%2FTestSuite.hs;h=172bcfcb42e9dd649fa64977f35261b8e0aa8d1c;hb=18a81546e7c4ad10574918efb08b2e104e911d73;hp=4450f1d34001afaf731f17159492c09e6501c7b1;hpb=a23ed449c784cdf81501c696bec10b1fbaeefc5f;p=hath.git diff --git a/test/TestSuite.hs b/test/TestSuite.hs index 4450f1d..172bcfc 100644 --- a/test/TestSuite.hs +++ b/test/TestSuite.hs @@ -1,34 +1,43 @@ -import Test.HUnit -import Test.QuickCheck.Batch +{-# LANGUAGE NoMonomorphismRestriction #-} +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_properties, + ipv4address_tests ) +import Octet ( + octet_properties, + octet_tests ) -import IPv4Address (ipv4address_tests) -import Maskable (maskable_tests) -import Octet (octet_tests) - --- The list of HUnit tests. -test_suite = TestList (concat [cidr_tests, - ipv4address_tests, - maskable_tests, - octet_tests]) - --- QuickCheck options -options = TestOptions { no_of_tests = 1000, - length_of_tests = 0, -- No time limit on tests. - debug_tests = False } +tests :: [Test.Framework.Test] +tests = [ cidr_properties, + cidr_tests, + ipv4address_properties, + ipv4address_tests, + octet_properties, + octet_tests ] main :: IO () main = do - putStrLn "HUnit" - putStrLn "-----" - runTestTT test_suite - - putStrLn "" + 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 "QuickCheck" - putStrLn "----------" - runTests "Cidr" options [ run prop_all_cidrs_contain_themselves, - run prop_contains_proper_intransitive] + defaultMainWithOpts tests my_runner_opts