on dev help sign in
disintegrate test suites
commitf94cce2644cd38838862d01e5852b3f86572c189 authorEitan Chatav <eitan@EEM109LMBP-1.local> dateWed 28 Aug 2019, 11:29 (7 years ago) parent65893e0
5 files changed+38−35
squeal-postgresql/squeal-postgresql.cabal+28−11 squeal-postgresql/test/Doc.hs+3−3 squeal-postgresql/test/Main.hs−14 squeal-postgresql/test/Property.hs+3−3 squeal-postgresql/test/Spec.hs+4−4
squeal-postgresql/squeal-postgresql.cabal+28−11
@@ -80,30 +80,47 @@ library
8080 , uuid-types >= 1.0.3
8181 , vector >= 0.12.0.1
8282
83−test-suite squeal-postgresql-test
83+test-suite squeal-postgresql-doctest
8484 default-language: Haskell2010
8585 type: exitcode-stdio-1.0
8686 hs-source-dirs: test
8787 ghc-options: -Wall
88− main-is: Main.hs
89− other-modules:
90− Doc
91− , Property
92− , Spec
88+ main-is: Doc.hs
89+ build-depends:
90+ base >= 4.10.0.0
91+ , doctest >= 0.11.4
92+ , squeal-postgresql
93+
94+test-suite squeal-postgresql-properties
95+ default-language: Haskell2010
96+ type: exitcode-stdio-1.0
97+ hs-source-dirs: test
98+ ghc-options: -Wall
99+ main-is: Property.hs
100+ build-depends:
101+ base >= 4.10.0.0
102+ , bytestring >= 0.10.8.2
103+ , hedgehog >= 1.0
104+ , mtl >= 2.2.2
105+ , scientific >= 0.3.5.3
106+ , squeal-postgresql
107+ , time >= 1.8.0.2
108+
109+test-suite squeal-postgresql-spec
110+ default-language: Haskell2010
111+ type: exitcode-stdio-1.0
112+ hs-source-dirs: test
113+ ghc-options: -Wall
114+ main-is: Spec.hs
93115 build-depends:
94116 base >= 4.10.0.0
95117 , async >= 2.2.2
96118 , bytestring >= 0.10.8.2
97− , doctest >= 0.11.4
98119 , generics-sop >= 0.3.1.0
99120 , hspec >= 2.4.8
100− , hedgehog >= 1.0
101121 , mtl >= 2.2.2
102− , scientific >= 0.3.5.3
103122 , squeal-postgresql
104123 , text >= 1.2.2.2
105− , time >= 1.8.0.2
106− , transformers >= 0.5.2.0
107124 , vector >= 0.12.0.1
108125
109126executable squeal-postgresql-example
squeal-postgresql/test/Doc.hs+3−3
@@ -1,9 +1,9 @@
1−module Doc (docTests) where
1+module Main (main) where
22
33import Test.DocTest
44
5−docTests :: IO ()
6−docTests = doctest
5+main :: IO ()
6+main = doctest
77 [ "-isrc"
88 , "src/Squeal/PostgreSQL.hs"
99 , "src/Squeal/PostgreSQL/Binary.hs"
squeal-postgresql/test/Main.hsdeleted−14
@@ -1,14 +0,0 @@
1−module Main (main) where
2−
3−import Doc (docTests)
4−import Spec (specTests)
5−import Property (propertyTests)
6−
7−main :: IO ()
8−main = do
9− putStrLn "\n\nRUN DOC TESTS\n\n"
10− docTests
11− putStrLn "\n\nRUN SPEC TESTS\n\n"
12− specTests
13− putStrLn "\n\nRUN PROP TESTS\n\n"
14− propertyTests
squeal-postgresql/test/Property.hs+3−3
@@ -8,7 +8,7 @@
88 , TypeOperators
99#-}
1010
11−module Property (propertyTests) where
11+module Main (main) where
1212
1313import Control.Monad.Trans
1414import Data.ByteString (ByteString)
@@ -21,8 +21,8 @@ import qualified Hedgehog.Gen as Gen
2121import qualified Hedgehog.Main as Main
2222import qualified Hedgehog.Range as Range
2323
24−propertyTests :: IO ()
25−propertyTests = Main.defaultMain
24+main :: IO ()
25+main = Main.defaultMain
2626 [ roundtrip int2 genInt16
2727 , roundtrip int4 genInt32
2828 , roundtrip int8 genInt64
squeal-postgresql/test/Spec.hs+4−4
@@ -14,7 +14,7 @@
1414 , TypeOperators
1515#-}
1616
17−module Spec (specTests) where
17+module Main (main) where
1818
1919import Control.Concurrent.Async (replicateConcurrently)
2020import Data.ByteString (ByteString)
@@ -27,6 +27,9 @@ import qualified GHC.Generics as GHC
2727
2828import Squeal.PostgreSQL
2929
30+main :: IO ()
31+main = hspec spec
32+
3033type Schemas = Public
3134 '[ "users" ::: 'Table (
3235 '[ "pk_users" ::: 'PrimaryKey '["id"]
@@ -120,6 +123,3 @@ spec = before_ setupDB . after_ dropDB $ do
120123 getRows =<< runQuery query
121124 (fromOnly <$> rangesOut :: [Range Int32]) `shouldBe`
122125 [ atLeast 3, 3 <=..< 5, Empty, whole ]
123−
124−specTests :: IO ()
125−specTests = hspec spec