on master help sign in
update tests for changes in config process
commitcbe30a71a33f5ba6abb803480b8bae00368300b4 authorCorey O'Connor <coreyoconnor@gmail.com> dateThu 14 Aug 2014, 15:08 (12 years ago) parent6f1a9f6
4 files changed+29−27
test/VerifyConfig.hs−7 test/VerifyOutput.hs+6−3 test/VerifyUsingMockInput.hs+6−1 vty.cabal+17−16
test/VerifyConfig.hs−7
@@ -4,11 +4,6 @@ module Main where
44import Graphics.Vty.Config
55import Graphics.Vty.Input.Events
66
7−import Control.Applicative
8−import Control.Exception
9−import Control.Lens ((^.))
10−import Control.Monad
11−
127import Data.Default
138import Data.String.QQ
149
@@ -16,8 +11,6 @@ import Test.Framework
1611import Test.Framework.Providers.HUnit
1712import Test.HUnit hiding (Test)
1813
19−import Text.Printf
20−
2114exampleConfig :: String
2215exampleConfig = [s|
2316-- comments should be ignored.
test/VerifyOutput.hs+6−3
@@ -12,9 +12,11 @@ import Verify.Graphics.Vty.Output
1212
1313import Control.Monad
1414
15+import Data.Default
16+
1517import qualified System.Console.Terminfo as Terminfo
1618import System.Posix.Env
17−import System.IO
19+import System.Posix.IO
1820
1921tests :: IO [Test]
2022tests = concat <$> forM terminalsOfInterest (\termName -> do
@@ -45,8 +47,8 @@ smokeTestTermMac termName i = liftIOResult $ do
4547
4648smokeTestTerm :: String -> Image -> IO Result
4749smokeTestTerm termName i = do
48− nullOut <- openFile "/dev/null" WriteMode
49− t <- outputForNameAndIO termName nullOut
50+ nullOut <- openFd "/dev/null" WriteOnly Nothing defaultFileFlags
51+ t <- outputForConfig $ def { outputFd = Just nullOut, termName = Just termName }
5052 -- putStrLn $ "context color count: " ++ show (contextColorCount t)
5153 reserveDisplay t
5254 dc <- displayContext t (100,100)
@@ -59,5 +61,6 @@ smokeTestTerm termName i = do
5961 showCursor t
6062 releaseDisplay t
6163 releaseTerminal t
64+ closeFd nullOut
6265 return succeeded
6366
test/VerifyUsingMockInput.hs+6−1
@@ -110,7 +110,12 @@ assertEventsFromSynInput table inputSpec expectedEvents = do
110110 (writeFd, readFd) <- openPseudoTerminal
111111 (setTermAttr,_) <- attributeControl readFd
112112 setTermAttr
113− input <- initInputForFd def "dummy" table readFd
113+ let testConfig = def { inputFd = Just readFd
114+ , termName = Just "dummy"
115+ , vmin = Just 1
116+ , vtime = Just 100
117+ }
118+ input <- initInput testConfig table
114119 eventsRef <- newIORef []
115120 let writeWaitClose = do
116121 synthesizeInput inputSpec writeFd
vty.cabal+17−16
@@ -137,7 +137,7 @@ test-suite verify-attribute-ops
137137 hs-source-dirs: test
138138 test-module: VerifyAttributeOps
139139 build-depends: vty,
140− Cabal == 1.18.*,
140+ Cabal >= 1.18,
141141 QuickCheck >= 2.4,
142142 random == 1.0.*,
143143 base >= 4 && < 5,
@@ -169,7 +169,7 @@ test-suite verify-using-mock-terminal
169169 Verify.Graphics.Vty.Output
170170
171171 build-depends: vty,
172− Cabal == 1.18.*,
172+ Cabal >= 1.18,
173173 QuickCheck >= 2.4,
174174 random == 1.0.*,
175175 base >= 4 && < 5,
@@ -202,12 +202,13 @@ test-suite verify-terminal
202202 Verify.Graphics.Vty.Output
203203
204204 build-depends: vty,
205− Cabal == 1.18.*,
205+ Cabal >= 1.18,
206206 QuickCheck >= 2.4,
207207 random == 1.0.*,
208208 base >= 4 && < 5,
209209 bytestring,
210210 containers,
211+ data-default >= 0.5.3,
211212 deepseq >= 1.1 && < 1.4,
212213 mtl >= 1.1.1.0 && < 2.3,
213214 terminfo >= 0.3 && < 0.5,
@@ -235,7 +236,7 @@ test-suite verify-display-attributes
235236 Verify.Graphics.Vty.Span
236237
237238 build-depends: vty,
238− Cabal == 1.18.*,
239+ Cabal >= 1.18,
239240 QuickCheck >= 2.4,
240241 random == 1.0.*,
241242 base >= 4 && < 5,
@@ -261,7 +262,7 @@ test-suite verify-empty-image-props
261262 other-modules: Verify
262263
263264 build-depends: vty,
264− Cabal == 1.18.*,
265+ Cabal >= 1.18,
265266 QuickCheck >= 2.4,
266267 random == 1.0.*,
267268 base >= 4 && < 5,
@@ -288,7 +289,7 @@ test-suite verify-eval-terminfo-caps
288289 Verify.Graphics.Vty.Output
289290
290291 build-depends: vty,
291− Cabal == 1.18.*,
292+ Cabal >= 1.18,
292293 QuickCheck >= 2.4,
293294 random == 1.0.*,
294295 base >= 4 && < 5,
@@ -318,7 +319,7 @@ test-suite verify-image-ops
318319 Verify.Graphics.Vty.Image
319320
320321 build-depends: vty,
321− Cabal == 1.18.*,
322+ Cabal >= 1.18,
322323 QuickCheck >= 2.4,
323324 random == 1.0.*,
324325 base >= 4 && < 5,
@@ -346,7 +347,7 @@ test-suite verify-image-trans
346347 Verify.Graphics.Vty.Image
347348
348349 build-depends: vty,
349− Cabal == 1.18.*,
350+ Cabal >= 1.18,
350351 QuickCheck >= 2.4,
351352 random == 1.0.*,
352353 base >= 4 && < 5,
@@ -373,7 +374,7 @@ test-suite verify-inline
373374 Verify.Graphics.Vty.Output
374375
375376 build-depends: vty,
376− Cabal == 1.18.*,
377+ Cabal >= 1.18,
377378 QuickCheck >= 2.4,
378379 random == 1.0.*,
379380 base >= 4 && < 5,
@@ -401,7 +402,7 @@ test-suite verify-parse-terminfo-caps
401402 Verify.Graphics.Vty.Output
402403
403404 build-depends: vty,
404− Cabal == 1.18.*,
405+ Cabal >= 1.18,
405406 QuickCheck >= 2.4,
406407 random == 1.0.*,
407408 base >= 4 && < 5,
@@ -433,7 +434,7 @@ test-suite verify-simple-span-generation
433434 Verify.Graphics.Vty.Span
434435
435436 build-depends: vty,
436− Cabal == 1.18.*,
437+ Cabal >= 1.18,
437438 QuickCheck >= 2.4,
438439 random == 1.0.*,
439440 base >= 4 && < 5,
@@ -465,7 +466,7 @@ test-suite verify-crop-span-generation
465466 Verify.Graphics.Vty.Span
466467
467468 build-depends: vty,
468− Cabal == 1.18.*,
469+ Cabal >= 1.18,
469470 QuickCheck >= 2.4,
470471 random == 1.0.*,
471472 base >= 4 && < 5,
@@ -497,7 +498,7 @@ test-suite verify-layers-span-generation
497498 Verify.Graphics.Vty.Span
498499
499500 build-depends: vty,
500− Cabal == 1.18.*,
501+ Cabal >= 1.18,
501502 QuickCheck >= 2.4,
502503 random == 1.0.*,
503504 base >= 4 && < 5,
@@ -523,7 +524,7 @@ test-suite verify-utf8-width
523524 other-modules: Verify
524525
525526 build-depends: vty,
526− Cabal == 1.18.*,
527+ Cabal >= 1.18,
527528 QuickCheck >= 2.4,
528529 random == 1.0.*,
529530 base >= 4 && < 5,
@@ -547,7 +548,7 @@ test-suite verify-using-mock-input
547548 main-is: VerifyUsingMockInput.hs
548549
549550 build-depends: vty,
550− Cabal == 1.18.*,
551+ Cabal >= 1.18,
551552 data-default >= 0.5.3,
552553 QuickCheck >= 2.4,
553554 smallcheck == 1.*,
@@ -580,7 +581,7 @@ test-suite verify-config
580581 main-is: VerifyConfig.hs
581582
582583 build-depends: vty,
583− Cabal == 1.18.*,
584+ Cabal >= 1.18,
584585 data-default >= 0.5.3,
585586 HUnit,
586587 QuickCheck >= 2.4,