]> gitweb.michael.orlitzky.com - hath.git/blobdiff - test/TestSuite.hs
Use test-framework for the tests, and bump some dependencies.
[hath.git] / test / TestSuite.hs
index 897807f9b6216b2f91a3a35ce525648393fcd051..3085c1b38f014eefc9b654a2a9caa381e3ed1bc1 100644 (file)
@@ -1,15 +1,46 @@
+{-# 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 Cidr (cidr_properties, cidr_tests)
 
-import Cidr (cidr_tests)
 import IPv4Address (ipv4address_tests)
-import Maskable (maskable_tests)
 import Octet (octet_tests)
 
-test_suite = TestList (concat [cidr_tests,
-                               ipv4address_tests,
-                               maskable_tests,
-                               octet_tests])
+tests :: [Test.Framework.Test]
+tests = [ cidr_properties,
+          cidr_tests,
+          ipv4address_tests,
+          octet_tests ]
 
-main :: IO Counts
+main :: IO ()
 main = do
-  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
+  }
+
+  defaultMainWithOpts tests my_runner_opts