130 |
130 |
131 fun merge_expectation (expect1, expect2) = |
131 fun merge_expectation (expect1, expect2) = |
132 if expect1 = expect2 then expect1 else No_Expectation |
132 if expect1 = expect2 then expect1 else No_Expectation |
133 |
133 |
134 (* quickcheck configuration -- default parameters, test generators *) |
134 (* quickcheck configuration -- default parameters, test generators *) |
135 val (tester, setup_tester) = Attrib.config_string "quickcheck_tester" (K "") |
135 val tester = Attrib.setup_config_string @{binding quickcheck_tester} (K "") |
136 val (size, setup_size) = Attrib.config_int "quickcheck_size" (K 10) |
136 val size = Attrib.setup_config_int @{binding quickcheck_size} (K 10) |
137 val (iterations, setup_iterations) = Attrib.config_int "quickcheck_iterations" (K 100) |
137 val iterations = Attrib.setup_config_int @{binding quickcheck_iterations} (K 100) |
138 val (no_assms, setup_no_assms) = Attrib.config_bool "quickcheck_no_assms" (K false) |
138 val no_assms = Attrib.setup_config_bool @{binding quickcheck_no_assms} (K false) |
139 val (report, setup_report) = Attrib.config_bool "quickcheck_report" (K true) |
139 val report = Attrib.setup_config_bool @{binding quickcheck_report} (K true) |
140 val (timing, setup_timing) = Attrib.config_bool "quickcheck_timing" (K false) |
140 val timing = Attrib.setup_config_bool @{binding quickcheck_timing} (K false) |
141 val (quiet, setup_quiet) = Attrib.config_bool "quickcheck_quiet" (K false) |
141 val quiet = Attrib.setup_config_bool @{binding quickcheck_quiet} (K false) |
142 val (timeout, setup_timeout) = Attrib.config_real "quickcheck_timeout" (K 30.0) |
142 val timeout = Attrib.setup_config_real @{binding quickcheck_timeout} (K 30.0) |
143 val (finite_types, setup_finite_types) = Attrib.config_bool "quickcheck_finite_types" (K true) |
143 val finite_types = Attrib.setup_config_bool @{binding quickcheck_finite_types} (K true) |
144 val (finite_type_size, setup_finite_type_size) = |
144 val finite_type_size = Attrib.setup_config_int @{binding quickcheck_finite_type_size} (K 3) |
145 Attrib.config_int "quickcheck_finite_type_size" (K 3) |
|
146 |
|
147 val setup_config = |
|
148 setup_tester #> setup_size #> setup_iterations #> setup_no_assms #> setup_report #> setup_timing |
|
149 #> setup_quiet #> setup_timeout #> setup_finite_types #> setup_finite_type_size |
|
150 |
145 |
151 datatype test_params = Test_Params of |
146 datatype test_params = Test_Params of |
152 {default_type: typ list, expect : expectation}; |
147 {default_type: typ list, expect : expectation}; |
153 |
148 |
154 fun dest_test_params (Test_Params {default_type, expect}) = (default_type, expect); |
149 fun dest_test_params (Test_Params {default_type, expect}) = (default_type, expect); |