]> gitweb.michael.orlitzky.com - hath.git/blobdiff - test/TestSuite.hs
Switch from test-framework to tasty.
[hath.git] / test / TestSuite.hs
index 3538d21141455e8d6938cdae4ff59fc3f497be43..7cd8d937938b9e245156823ed5e3b393c5b5d3cb 100644 (file)
@@ -1,32 +1,21 @@
-import Test.HUnit
-import Test.QuickCheck.Batch
+import Test.Tasty ( TestTree, defaultMain, localOption, testGroup )
+import Test.Tasty.QuickCheck ( QuickCheckTests(..), QuickCheckMaxRatio(..) )
+import Cidr ( cidr_properties, cidr_tests )
+import IPv4Address ( ipv4address_properties, ipv4address_tests )
+import Octet ( octet_properties, octet_tests )
 
-import Cidr (cidr_tests,
-             prop_all_cidrs_contain_themselves)
-
-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 :: TestTree
+tests = testGroup "All Tests" [
+          cidr_properties,
+          cidr_tests,
+          ipv4address_properties,
+          ipv4address_tests,
+          octet_properties,
+          octet_tests ]
 
+-- TODO: Run 5000 generated tests, we have a large space.
 main :: IO ()
-main = do
-  putStrLn "HUnit"
-  putStrLn "-----"
-  runTestTT test_suite
-
-  putStrLn ""
-
-  putStrLn "QuickCheck"
-  putStrLn "----------"
-  runTests "Cidr" options [ run prop_all_cidrs_contain_themselves ]
+main =
+  defaultMain $
+    localOption (QuickCheckTests 5000) $
+    localOption (QuickCheckMaxRatio 50) tests