Disable ropt_plain_output.
authorMilan Straka <fox@ucw.cz>
Fri, 2 Mar 2012 16:48:44 +0000 (17:48 +0100)
committerMilan Straka <fox@ucw.cz>
Fri, 2 Mar 2012 16:48:44 +0000 (17:48 +0100)
The ropt_plain_output was used to disables ansi sequences in the test
log. But it works only for test-framework < 0.5.

In test-framework >= 0.5, ropt_plain_output no longer exists. The line
"ropt_color_mode = Just ColorNever" can be used, but test-framework >= 0.5
detects it is not writing to the terminal and disables ansi sequences by
itself.

It is difficult to compile ropt_plain_output conditionally for
test-framework < 0.5 only (MIN_VERSION_* macros are not defined for
dependencies of tests, conditions in cabal tests do not work for
ghc-7.0). We therefore do not set ropt_plain_output and live with ansi
sequences in test logs produces by test-framework < 0.5.

tests/intmap-properties.hs
tests/intset-properties.hs
tests/map-properties.hs
tests/seq-properties.hs
tests/set-properties.hs

index 58baff4..534b829 100644 (file)
@@ -144,8 +144,7 @@ main = defaultMainWithOpts
              ] opts
 
   where
-    opts = mempty { ropt_plain_output = Just True
-                  , ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
+    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
                                                       , topt_maximum_unsuitable_generated_tests = Just 500
                                                       }
                   }
index 48f60f4..b80d27d 100644 (file)
@@ -46,8 +46,7 @@ main = defaultMainWithOpts [ testProperty "prop_Single" prop_Single
                            , testProperty "prop_filter" prop_filter
                            ] opts
   where
-    opts = mempty { ropt_plain_output = Just True
-                  , ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
+    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
                                                       , topt_maximum_unsuitable_generated_tests = Just 500
                                                       }
                   }
index 0fe4048..bcca177 100644 (file)
@@ -170,8 +170,7 @@ main = defaultMainWithOpts
          ] opts
 
   where
-    opts = mempty { ropt_plain_output = Just True
-                  , ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
+    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
                                                       , topt_maximum_unsuitable_generated_tests = Just 500
                                                       }
                   }
index 992df6b..48ceebf 100644 (file)
@@ -93,11 +93,11 @@ main = defaultMainWithOpts
        ] opts
 
   where
-    opts = mempty { ropt_plain_output = Just True
-                  , ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
+    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
                                                       , topt_maximum_unsuitable_generated_tests = Just 500
                                                       }
                   }
+
 ------------------------------------------------------------------------
 -- Arbitrary
 ------------------------------------------------------------------------
index 831ace3..260b42f 100644 (file)
@@ -49,8 +49,7 @@ main = defaultMainWithOpts [ testProperty "prop_Valid" prop_Valid
                            , testProperty "prop_filter" prop_filter
                            ] opts
   where
-    opts = mempty { ropt_plain_output = Just True
-                  , ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
+    opts = mempty { ropt_test_options = Just $ mempty { topt_maximum_generated_tests = Just 500
                                                       , topt_maximum_unsuitable_generated_tests = Just 500
                                                       }
                   }