+module TestSuite
+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.DocTest
+import Test.Framework.Providers.HUnit (testCase)
+import Test.Framework.Providers.QuickCheck2 (testProperty)
import Test.HUnit
-import Test.QuickCheck
+import Test.QuickCheck (Testable ())
-import Tests.Face as TF
-import Tests.Misc
-import Tests.Tetrahedron as TT
-
--- The list of HUnit tests.
-test_suite = TestList (concat [misc_tests,
- tetrahedron_tests])
+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)
main :: IO ()
main = do
- putStrLn "HUnit"
- putStrLn "-----"
- runTestTT test_suite
- putStrLn ""
- putStrLn "QuickCheck"
- putStrLn "----------"
- let qc_args = stdArgs { maxSuccess = 100,
- maxDiscard = 500,
- maxSize = 100 }
-
- putStr "prop_all_volumes_positive... "
- quickCheckWith qc_args prop_all_volumes_positive
-
- putStr "prop_factorial_greater... "
- quickCheckWith qc_args prop_factorial_greater
-
- putStr "prop_b0_v0_always_unity... "
- quickCheckWith qc_args prop_b0_v0_always_unity
-
- putStr "prop_b0_v1_always_zero... "
- quickCheckWith qc_args prop_b0_v1_always_zero
-
- putStr "prop_b0_v2_always_zero... "
- quickCheckWith qc_args prop_b0_v2_always_zero
-
- putStr "prop_b0_v3_always_zero... "
- quickCheckWith qc_args prop_b0_v3_always_zero
-
- putStr "prop_b1_v1_always_unity... "
- quickCheckWith qc_args prop_b1_v1_always_unity
-
- putStr "prop_b1_v0_always_zero... "
- quickCheckWith qc_args prop_b1_v0_always_zero
-
- putStr "prop_b1_v2_always_zero... "
- quickCheckWith qc_args prop_b1_v2_always_zero
-
- putStr "prop_b1_v3_always_zero... "
- quickCheckWith qc_args prop_b1_v3_always_zero
-
- putStr "prop_b2_v2_always_unity... "
- quickCheckWith qc_args prop_b2_v2_always_unity
-
- putStr "prop_b2_v0_always_zero... "
- quickCheckWith qc_args prop_b2_v0_always_zero
-
- putStr "prop_b2_v1_always_zero... "
- quickCheckWith qc_args prop_b2_v1_always_zero
-
- putStr "prop_b2_v3_always_zero... "
- quickCheckWith qc_args prop_b2_v3_always_zero
-
- putStr "prop_b3_v3_always_unity... "
- quickCheckWith qc_args prop_b3_v3_always_unity
-
- putStr "prop_b3_v0_always_zero... "
- quickCheckWith qc_args prop_b3_v0_always_zero
-
- putStr "prop_b3_v1_always_zero... "
- quickCheckWith qc_args prop_b3_v1_always_zero
-
- putStr "prop_b3_v2_always_zero... "
- quickCheckWith qc_args prop_b3_v2_always_zero
-
- putStr "prop_c3000_identity... "
- quickCheckWith qc_args TT.prop_c3000_identity
-
- putStr "prop_c2100_identity... "
- quickCheckWith qc_args TT.prop_c2100_identity
-
- putStr "prop_c1110_identity... "
- quickCheckWith qc_args TT.prop_c1110_identity
-
- putStrLn "\np. 79, (2.6)\n"
-
- putStr "prop_c0120_identity1... "
- quickCheckWith qc_args TF.prop_c0120_identity1
-
- putStr "prop_c0210_identity1... "
- quickCheckWith qc_args TF.prop_c0210_identity1
-
- putStr "prop_c0300_identity1... "
- quickCheckWith qc_args TF.prop_c0300_identity1
-
- putStr "prop_c1110_identity... "
- quickCheckWith qc_args TF.prop_c1110_identity
-
- putStr "prop_c1200_identity1... "
- quickCheckWith qc_args prop_c1200_identity1
-
- putStr "prop_c2100_identity1... "
- quickCheckWith qc_args TF.prop_c2100_identity1
-
- putStrLn "\np. 79, (2.7)\n"
-
- putStr "prop_c0102_identity1... "
- quickCheckWith qc_args TF.prop_c0102_identity1
-
- putStr "prop_c0201_identity1... "
- quickCheckWith qc_args TF.prop_c0201_identity1
-
- putStr "prop_c0300_identity2... "
- quickCheckWith qc_args TF.prop_c0300_identity2
-
- putStr "prop_c1101_identity... "
- quickCheckWith qc_args TF.prop_c1101_identity
-
- putStr "prop_c1200_identity2... "
- quickCheckWith qc_args TF.prop_c1200_identity2
-
- putStr "prop_c2100_identity2... "
- quickCheckWith qc_args TF.prop_c2100_identity2
-
- putStrLn "\np. 79, (2.8)\n"
-
- putStr "prop_c3000_identity... "
- quickCheckWith qc_args TF.prop_c3000_identity
-
- putStr "prop_c2010_identity... "
- quickCheckWith qc_args TF.prop_c2010_identity
-
- putStr "prop_c2001_identity... "
- quickCheckWith qc_args TF.prop_c2001_identity
-
- putStr "prop_c1020_identity... "
- quickCheckWith qc_args TF.prop_c1020_identity
-
- putStr "prop_c1002_identity... "
- quickCheckWith qc_args TF.prop_c1002_identity
+ dt <- docTest ["src/Everything.hs"] ["-isrc"]
- putStr "prop_c1011_identity... "
- quickCheckWith qc_args TF.prop_c1011_identity
+ let empty_test_opts = mempty :: TestOptions
+ let my_test_opts = empty_test_opts {
+ topt_maximum_generated_tests = Just 1000
+ }
- putStrLn "\np. 80, (2.9)\n"
+ let empty_runner_opts = mempty :: RunnerOptions
+ let my_runner_opts = empty_runner_opts {
+ ropt_test_options = Just my_test_opts
+ }
- putStr "prop_c0120_identity2... "
- quickCheckWith qc_args TF.prop_c0120_identity2
+ defaultMainWithOpts ([dt] ++ tests) my_runner_opts
- putStr "prop_c0102_identity2... "
- quickCheckWith qc_args TF.prop_c0102_identity2
- putStr "prop_c0111_identity... "
- quickCheckWith qc_args TF.prop_c0111_identity
+-- | Defined so that my test names fit on one line.
+tc :: Test.Framework.Providers.API.TestName -> Test.HUnit.Assertion -> Test.Framework.Test
+tc = testCase
- putStr "prop_c0210_identity2... "
- quickCheckWith qc_args TF.prop_c0210_identity2
- putStr "prop_c0201_identity2... "
- quickCheckWith qc_args TF.prop_c0201_identity2
+-- | Defined so that my test names fit on one line.
+tp :: Test.QuickCheck.Testable a => Test.Framework.TestName -> a -> Test.Framework.Test
+tp = testProperty
- putStr "prop_c0300_identity3... "
- quickCheckWith qc_args TF.prop_c0300_identity3
- return ()
+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 ]