]> gitweb.michael.orlitzky.com - spline3.git/blob - test/TestSuite.hs
Move the Tetrahedron tests into the Tetrehedron module.
[spline3.git] / test / TestSuite.hs
1 module TestSuite
2 where
3
4 import Test.Framework (defaultMain, testGroup, Test, TestName, TestOptions(..))
5 import Test.Framework.Providers.API (TestName)
6 import Test.Framework.Providers.DocTest
7 import Test.Framework.Providers.HUnit (testCase)
8 import Test.Framework.Providers.QuickCheck2 (testProperty)
9 import Test.HUnit
10 import Test.QuickCheck (Testable ())
11
12 import Cardinal (cardinal_tests, cardinal_properties)
13 import FunctionValues (function_values_tests, function_values_properties)
14 import Grid (grid_tests, slow_tests)
15 import Misc (misc_tests, misc_properties)
16 import Tests.Cube as TC
17 import Tetrahedron (tetrahedron_tests, tetrahedron_properties)
18
19 main :: IO ()
20 main = do
21 dt <- docTest ["src/Everything.hs"] ["-isrc"]
22 defaultMain $ [dt] ++ tests
23
24 -- | Defined so that my test names fit on one line.
25 tc :: Test.Framework.Providers.API.TestName -> Test.HUnit.Assertion -> Test.Framework.Test
26 tc = testCase
27
28
29 -- | Defined so that my test names fit on one line.
30 tp :: Test.QuickCheck.Testable a => Test.Framework.TestName -> a -> Test.Framework.Test
31 tp = testProperty
32
33
34
35 p78_25_properties :: Test.Framework.Test
36 p78_25_properties =
37 testGroup "p. 78, Section (2.5) Properties" [
38 tp "c_ijk1 identity" prop_cijk1_identity ]
39
40 edge_incidence_tests :: Test.Framework.Test
41 edge_incidence_tests =
42 testGroup "Edge Incidence Tests" [
43 tp "t0 shares edge with t6" prop_t0_shares_edge_with_t6,
44 tp "t0 shares edge with t1" prop_t0_shares_edge_with_t1,
45 tp "t0 shares edge with t3" prop_t0_shares_edge_with_t3,
46 tp "t1 shares edge with t2" prop_t1_shares_edge_with_t2,
47 tp "t1 shares edge with t19" prop_t1_shares_edge_with_t19,
48 tp "t2 shares edge with t3" prop_t2_shares_edge_with_t3,
49 tp "t2 shares edge with t12" prop_t2_shares_edge_with_t12,
50 tp "t3 shares edge with t21" prop_t3_shares_edge_with_t21,
51 tp "t4 shares edge with t5" prop_t4_shares_edge_with_t5,
52 tp "t4 shares edge with t7" prop_t4_shares_edge_with_t7,
53 tp "t4 shares edge with t10" prop_t4_shares_edge_with_t10,
54 tp "t5 shares edge with t6" prop_t5_shares_edge_with_t6,
55 tp "t5 shares edge with t16" prop_t5_shares_edge_with_t16,
56 tp "t6 shares edge with t7" prop_t6_shares_edge_with_t7,
57 tp "t7 shares edge with t20" prop_t7_shares_edge_with_t20 ]
58
59
60 p79_26_properties :: Test.Framework.Test
61 p79_26_properties =
62 testGroup "p. 79, Section (2.6) Properties" [
63 tp "c0120 identity1" TC.prop_c0120_identity1,
64 tp "c0120 identity2" TC.prop_c0120_identity2,
65 tp "c0120 identity3" TC.prop_c0120_identity3,
66 tp "c0120 identity4" TC.prop_c0120_identity4,
67 tp "c0120 identity5" TC.prop_c0120_identity5,
68 tp "c0120 identity6" TC.prop_c0120_identity6,
69 tp "c0120 identity7" TC.prop_c0120_identity7,
70 tp "c0210 identity1" TC.prop_c0210_identity1,
71 tp "c0300 identity1" TC.prop_c0300_identity1,
72 tp "c1110 identity" TC.prop_c1110_identity,
73 tp "c1200 identity1" TC.prop_c1200_identity1,
74 tp "c2100 identity1" TC.prop_c2100_identity1]
75
76 p79_27_properties :: Test.Framework.Test
77 p79_27_properties =
78 testGroup "p. 79, Section (2.7) Properties" [
79 tp "c0102 identity1" TC.prop_c0102_identity1,
80 tp "c0201 identity1" TC.prop_c0201_identity1,
81 tp "c0300 identity2" TC.prop_c0300_identity2,
82 tp "c1101 identity" TC.prop_c1101_identity,
83 tp "c1200 identity2" TC.prop_c1200_identity2,
84 tp "c2100 identity2" TC.prop_c2100_identity2 ]
85
86
87 p79_28_properties :: Test.Framework.Test
88 p79_28_properties =
89 testGroup "p. 79, Section (2.8) Properties" [
90 tp "c3000 identity" TC.prop_c3000_identity,
91 tp "c2010 identity" TC.prop_c2010_identity,
92 tp "c2001 identity" TC.prop_c2001_identity,
93 tp "c1020 identity" TC.prop_c1020_identity,
94 tp "c1002 identity" TC.prop_c1002_identity,
95 tp "c1011 identity" TC.prop_c1011_identity ]
96
97
98 cube_properties :: Test.Framework.Test
99 cube_properties =
100 testGroup "Cube Properties" [
101 tp "opposite octant tetrahedra are disjoint (1)"
102 prop_opposite_octant_tetrahedra_disjoint1,
103 tp "opposite octant tetrahedra are disjoint (2)"
104 prop_opposite_octant_tetrahedra_disjoint2,
105 tp "opposite octant tetrahedra are disjoint (3)"
106 prop_opposite_octant_tetrahedra_disjoint3,
107 tp "opposite octant tetrahedra are disjoint (4)"
108 prop_opposite_octant_tetrahedra_disjoint4,
109 tp "opposite octant tetrahedra are disjoint (5)"
110 prop_opposite_octant_tetrahedra_disjoint5,
111 tp "opposite octant tetrahedra are disjoint (6)"
112 prop_opposite_octant_tetrahedra_disjoint6,
113 tp "all volumes positive" prop_all_volumes_positive,
114 tp "all volumes exact" prop_all_volumes_exact,
115 tp "v0 all equal" prop_v0_all_equal,
116 tp "interior values all identical" prop_interior_values_all_identical,
117 tp "c-tilde_2100 rotation correct" prop_c_tilde_2100_rotation_correct,
118 tp "c-tilde_2100 correct" prop_c_tilde_2100_correct ]
119
120
121 tests :: [Test.Framework.Test]
122 tests = [ cardinal_tests,
123 function_values_tests,
124 grid_tests,
125 misc_tests,
126 tetrahedron_tests,
127 cube_properties,
128 tetrahedron_properties,
129 misc_properties,
130 cardinal_properties,
131 edge_incidence_tests,
132 -- p78_25_properties,
133 p79_26_properties,
134 p79_27_properties,
135 p79_28_properties,
136 slow_tests ]