X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=test%2FTestSuite.hs;h=fa39ef3de373a3a921fef21a425111d55509db1e;hb=a8c2d85d8611f7f56eaa0c3406ec423d68f81f96;hp=3085c1b38f014eefc9b654a2a9caa381e3ed1bc1;hpb=d32fe2f0a6c83ba3046a405eda40f83c794c000d;p=hath.git diff --git a/test/TestSuite.hs b/test/TestSuite.hs index 3085c1b..fa39ef3 100644 --- a/test/TestSuite.hs +++ b/test/TestSuite.hs @@ -1,46 +1,25 @@ -{-# LANGUAGE NoMonomorphismRestriction #-} -import Data.Monoid (mempty) -import Test.Framework ( - RunnerOptions(), - Test, - TestName, - TestOptions(), - defaultMainWithOpts, - testGroup - ) -import Test.Framework.Options -import Test.Framework.Runners.Options -import Test.Framework.Providers.API (TestName) -import Test.Framework.Providers.HUnit (testCase) -import Test.Framework.Providers.QuickCheck2 (testProperty) -import Test.HUnit -import Test.QuickCheck (Testable ()) +import Test.Tasty( TestTree, defaultMain, localOption, testGroup ) +import Test.Tasty.QuickCheck( + QuickCheckTests( QuickCheckTests ), + QuickCheckMaxRatio( QuickCheckMaxRatio )) +import Cidr( cidr_properties, cidr_tests ) +import IPv4Address( ipv4address_properties, ipv4address_tests ) +import Octet( octet_properties, octet_tests ) -import Cidr (cidr_properties, cidr_tests) - -import IPv4Address (ipv4address_tests) -import Octet (octet_tests) - -tests :: [Test.Framework.Test] -tests = [ cidr_properties, +tests :: TestTree +tests = testGroup "All Tests" [ + cidr_properties, cidr_tests, + ipv4address_properties, ipv4address_tests, + octet_properties, octet_tests ] +-- | Warning: the QuickCheckMaxRatio option is not a ratio. It's +-- currently set to \"100%\", so that the test suite passes even if +-- we have to throw out all of our random test cases. main :: IO () -main = do - 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 - } - - defaultMainWithOpts tests my_runner_opts +main = + defaultMain $ + localOption (QuickCheckTests 5000) $ + localOption (QuickCheckMaxRatio 5000) tests