2013-05-11 10:23:41 +04:00
|
|
|
module BenchImageFuzz where
|
|
|
|
import Graphics.Vty
|
|
|
|
import Graphics.Vty.Debug
|
|
|
|
|
|
|
|
import Verify.Graphics.Vty.Image
|
|
|
|
import Verify
|
|
|
|
|
|
|
|
import Control.Applicative
|
|
|
|
import Control.Monad
|
|
|
|
|
2014-01-27 01:25:13 +04:00
|
|
|
import Data.Default (def)
|
|
|
|
|
2013-05-11 10:23:41 +04:00
|
|
|
import System.Random
|
|
|
|
|
|
|
|
rand :: Arbitrary a => IO a
|
|
|
|
rand = head <$> sample' arbitrary
|
|
|
|
|
2013-07-27 12:00:25 +04:00
|
|
|
random_image :: IO Image
|
|
|
|
random_image = rand
|
2013-05-11 10:23:41 +04:00
|
|
|
|
2013-07-27 12:00:25 +04:00
|
|
|
random_picture = pic_for_image <$> random_image
|
2013-05-11 10:23:41 +04:00
|
|
|
|
|
|
|
bench_0 = do
|
2014-01-27 01:25:13 +04:00
|
|
|
vty <- mkVty def
|
2013-12-25 11:03:22 +04:00
|
|
|
(w,h) <- display_bounds $ output_iface vty
|
2013-08-14 00:53:40 +04:00
|
|
|
let pictures = replicateM 3000 random_picture
|
2013-05-11 10:23:41 +04:00
|
|
|
bench ps = do
|
|
|
|
forM ps (update vty)
|
|
|
|
shutdown vty
|
|
|
|
return $ Bench pictures bench
|
|
|
|
|