module Main
where
-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(..) )
-import Cardinal (cardinal_tests, cardinal_properties)
-import Cube (cube_properties)
-import FunctionValues (function_values_tests, function_values_properties)
-import Grid (grid_tests, slow_tests)
-import Misc (misc_tests, misc_properties)
-import Tetrahedron (tetrahedron_tests, tetrahedron_properties)
+import Cardinal ( cardinal_tests, cardinal_properties )
+import Cube ( cube_properties )
+import FunctionValues ( function_values_tests, function_values_properties )
+import Grid ( grid_properties, grid_tests, slow_tests )
+import Misc ( misc_tests, misc_properties )
+import Tetrahedron ( tetrahedron_tests, tetrahedron_properties )
main :: IO ()
main = do
- let empty_test_opts = mempty :: TestOptions
- let my_test_opts = empty_test_opts {
- topt_maximum_generated_tests = Just 500
- }
-
- 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
-
-
--- | Defined so that my test names fit on one line.
-tc :: Test.Framework.Providers.API.TestName -> Test.HUnit.Assertion -> Test.Framework.Test
-tc = testCase
-
-
--- | Defined so that my test names fit on one line.
-tp :: Test.QuickCheck.Testable a => Test.Framework.TestName -> a -> Test.Framework.Test
-tp = testProperty
-
-
-tests :: [Test.Framework.Test]
-tests = [ cardinal_tests,
- function_values_tests,
- grid_tests,
- misc_tests,
- tetrahedron_tests,
- cube_properties,
- tetrahedron_properties,
- misc_properties,
- cardinal_properties,
- slow_tests ]
+ defaultMain $ localOption (QuickCheckTests 500) tests
+
+
+tests :: TestTree
+tests =
+ testGroup "All tests"
+ [ cardinal_tests,
+ function_values_tests,
+ grid_tests,
+ misc_tests,
+ tetrahedron_tests,
+ grid_properties,
+ cube_properties,
+ tetrahedron_properties,
+ misc_properties,
+ cardinal_properties,
+ slow_tests ]