git.iko.soy/servant-quickcheck
on bb81779 help sign in
7 files changed+69−118
since splitsnapshots
unifiedsplit
.travis.yml+50−63 CHANGELOG.yaml−15 cabal.haskell-ci−7 cabal.project−4 servant-quickcheck.cabal+13−13 src/Servant/QuickCheck/Internal/HasGenRequest.hs+6−9 src/Servant/QuickCheck/Internal/QuickCheck.hs−7
.travis.yml+50−63
@@ -1,18 +1,12 @@
11# This Travis job script has been generated by a script via
22#
3−# haskell-ci '--config=cabal.haskell-ci' 'servant-quickcheck.cabal'
4−#
5−# To regenerate the script (for example after adjusting tested-with) run
6−#
7−# haskell-ci regenerate
3+# haskell-ci '--branches' 'master' '-o' '.travis.yml' 'servant-quickcheck.cabal'
84#
95# For more information, see https://github.com/haskell-CI/haskell-ci
106#
11−# version: 0.10.1
7+# version: 0.3.20190413
128#
13−version: ~> 1.0
149language: c
15−os: linux
1610dist: xenial
1711git:
1812 # whether to recursively clone submodules
@@ -24,7 +18,6 @@ cache:
2418 directories:
2519 - $HOME/.cabal/packages
2620 - $HOME/.cabal/store
27− - $HOME/.hlint
2821before_cache:
2922 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
3023 # remove files that are regenerated by 'cabal update'
@@ -34,63 +27,67 @@ before_cache:
3427 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
3528 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
3629 - rm -rfv $CABALHOME/packages/head.hackage
37−jobs:
30+matrix:
3831 include:
39− - compiler: ghc-8.8.3
40− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.3","cabal-install-3.2"]}}
41− os: linux
42− - compiler: ghc-8.6.5
43− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.2"]}}
44− os: linux
32+ - compiler: ghc-8.6.4
33+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.4","cabal-install-2.4"]}}
4534 - compiler: ghc-8.4.4
46− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.2"]}}
47− os: linux
35+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
4836 - compiler: ghc-8.2.2
49− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.2"]}}
50− os: linux
37+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
5138 - compiler: ghc-8.0.2
52− addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.2"]}}
53− os: linux
39+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
5440before_install:
5541 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
56− - WITHCOMPILER="-w $HC"
57− - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
5842 - HCPKG="$HC-pkg"
5943 - unset CC
6044 - CABAL=/opt/ghc/bin/cabal
6145 - CABALHOME=$HOME/.cabal
6246 - export PATH="$CABALHOME/bin:$PATH"
6347 - TOP=$(pwd)
64− - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
48+ - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
6549 - echo $HCNUMVER
66− - CABAL="$CABAL -vnormal+nowrap"
50+ - CABAL="$CABAL -vnormal+nowrap+markoutput"
6751 - set -o pipefail
52+ - |
53+ echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
54+ echo 'BEGIN { state = "output"; }' >> .colorful.awk
55+ echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
56+ echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
57+ echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
58+ echo ' if (state == "cabal") {' >> .colorful.awk
59+ echo ' print blue($0)' >> .colorful.awk
60+ echo ' } else {' >> .colorful.awk
61+ echo ' print $0' >> .colorful.awk
62+ echo ' }' >> .colorful.awk
63+ echo '}' >> .colorful.awk
64+ - cat .colorful.awk
65+ - |
66+ color_cabal_output () {
67+ awk -f $TOP/.colorful.awk
68+ }
69+ - echo text | color_cabal_output
70+install:
71+ - ${CABAL} --version
72+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
6873 - TEST=--enable-tests
6974 - BENCH=--enable-benchmarks
70− - HEADHACKAGE=false
75+ - GHCHEAD=${GHCHEAD-false}
7176 - rm -f $CABALHOME/config
7277 - |
7378 echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
7479 echo "remote-build-reporting: anonymous" >> $CABALHOME/config
75− echo "write-ghc-environment-files: always" >> $CABALHOME/config
7680 echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
7781 echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
7882 echo "world-file: $CABALHOME/world" >> $CABALHOME/config
7983 echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
8084 echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
81− echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
8285 echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
8386 echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
8487 echo "install-dirs user" >> $CABALHOME/config
8588 echo " prefix: $CABALHOME" >> $CABALHOME/config
8689 echo "repository hackage.haskell.org" >> $CABALHOME/config
8790 echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
88−install:
89− - ${CABAL} --version
90− - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
91− - |
92− echo "program-default-options" >> $CABALHOME/config
93− echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
9491 - cat $CABALHOME/config
9592 - rm -fv cabal.project cabal.project.local cabal.project.freeze
9693 - travis_retry ${CABAL} v2-update -v
@@ -98,61 +95,51 @@ install:
9895 - rm -rf cabal.project cabal.project.local cabal.project.freeze
9996 - touch cabal.project
10097 - |
101− echo "packages: ." >> cabal.project
102− - if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-quickcheck' >> cabal.project ; fi
103− - "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
98+ echo 'packages: "."' >> cabal.project
10499 - |
105− - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-quickcheck)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
100+ echo "write-ghc-environment-files: always" >> cabal.project
101+ - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(servant-quickcheck)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
106102 - cat cabal.project || true
107103 - cat cabal.project.local || true
108104 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
109− - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
105+ - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
110106 - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
111107 - rm cabal.project.freeze
112− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
113− - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
108+ - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
109+ - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
114110script:
115111 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
116112 # Packaging...
117− - ${CABAL} v2-sdist all
113+ - ${CABAL} v2-sdist all | color_cabal_output
118114 # Unpacking...
119115 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
120116 - cd ${DISTDIR} || false
121− - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
122− - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
123− - PKGDIR_servant_quickcheck="$(find . -maxdepth 1 -type d -regex '.*/servant-quickcheck-[0-9.]*')"
117+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
124118 # Generate cabal.project
125119 - rm -rf cabal.project cabal.project.local cabal.project.freeze
126120 - touch cabal.project
127121 - |
128− echo "packages: ${PKGDIR_servant_quickcheck}" >> cabal.project
129− - if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-quickcheck' >> cabal.project ; fi
130− - "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
122+ echo 'packages: "servant-quickcheck-*/*.cabal"' >> cabal.project
131123 - |
132− - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-quickcheck)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
124+ echo "write-ghc-environment-files: always" >> cabal.project
125+ - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(servant-quickcheck)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
133126 - cat cabal.project || true
134127 - cat cabal.project.local || true
135128 # Building...
136129 # this builds all libraries and executables (without tests/benchmarks)
137− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
130+ - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
138131 # Building with tests and benchmarks...
139132 # build & run tests, build benchmarks
140− - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
133+ - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
141134 # Testing...
142− - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
135+ - ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
143136 # cabal check...
144− - (cd ${PKGDIR_servant_quickcheck} && ${CABAL} -vnormal check)
137+ - (cd servant-quickcheck-* && ${CABAL} -vnormal check)
145138 # haddock...
146− - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
139+ - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
147140 # Building without installed constraints for packages in global-db...
148141 - rm -f cabal.project.local
149− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
150− # Constraint sets
151− - rm -rf cabal.project.local
152− # Constraint set base-compat-0.10
153− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.10.*' all
154− # Constraint set base-compat-0.11
155− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.11.*' all
142+ - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
156143
157−# REGENDATA ("0.10.1",["--config=cabal.haskell-ci","servant-quickcheck.cabal"])
144+# REGENDATA ["--branches","master","-o",".travis.yml","servant-quickcheck.cabal"]
158145# EOF
CHANGELOG.yaml−15
@@ -1,19 +1,4 @@
11releases:
2− - version: "0.0.9.0"
3− changes:
4− - description: "Support servant-0.15 (#65)"
5− authors: fizruk
6− date: 2020-06-25
7−
8− - description: "Relax constraints for GHC 8.10 (#70)"
9− authors: felixmulder
10− date: 2020-06-20
11−
12− - version: "0.0.8.0"
13− changes:
14− - description: Support for servant-0.17
15− authors: phadej
16− date: 2019-01-23
172
183 - version: "0.0.7.3"
194 changes:
cabal.haskell-cideleted−7
@@ -1,7 +0,0 @@
1−branches: master
2−
3−constraint-set base-compat-0.10
4− constraints: base-compat ==0.10.*
5−
6−constraint-set base-compat-0.11
7− constraints: base-compat ==0.11.*
cabal.projectdeleted−4
@@ -1,4 +0,0 @@
1−packages: .
2−tests: true
3−
4−allow-newer: servant-blaze:servant
servant-quickcheck.cabal+13−13
@@ -1,5 +1,5 @@
11name: servant-quickcheck
2−version: 0.0.9.1
2+version: 0.0.7.4
33synopsis: QuickCheck entire APIs
44description:
55 This packages provides QuickCheck properties that are tested across an entire
@@ -13,7 +13,7 @@ category: Web
1313build-type: Simple
1414cabal-version: >=1.10
1515extra-source-files: CHANGELOG.yaml
16−tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || == 8.8.3
16+tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.4
1717
1818source-repository head
1919 type: git
@@ -35,32 +35,32 @@ library
3535
3636 build-depends:
3737 aeson >=0.8 && <2
38− , base >=4.9 && <4.15
39− , base-compat-batteries >=0.10.1 && <0.12
38+ , base >=4.9 && <4.13
39+ , base-compat-batteries >=0.10.1 && <0.11
4040 , bytestring >=0.10 && <0.11
4141 , case-insensitive >=1.2 && <1.3
42− , clock >=0.7 && <0.9
42+ , clock >=0.7 && <0.8
4343 , data-default-class >=0.0 && <0.2
4444 , hspec >=2.5.6 && <2.8
45− , http-client >=0.4.30 && <0.8
45+ , http-client >=0.4.30 && <0.7
4646 , http-media >=0.6 && <0.9
4747 , http-types >=0.8 && <0.13
4848 , mtl >=2.1 && <2.3
4949 , pretty >=1.1 && <1.2
5050 , process >=1.2 && <1.7
51− , QuickCheck >=2.7 && <2.15
52− , servant >=0.17 && <0.19
53− , servant-client >=0.17 && <0.19
54− , servant-server >=0.17 && <0.19
51+ , QuickCheck >=2.7 && <2.14
52+ , servant >=0.15 && <0.17
53+ , servant-client >=0.15 && <0.17
54+ , servant-server >=0.15 && <0.17
5555 , split >=0.2 && <0.3
5656 , string-conversions >=0.3 && <0.5
5757 , temporary >=1.2 && <1.4
5858 , text >=1 && <2
59− , time >=1.5 && <1.11
60− , warp >=3.2.4 && <3.4
59+ , time >=1.5 && <1.9
60+ , warp >=3.2.4 && <3.3
6161
6262 if !impl(ghc >=8.0)
63− build-depends: semigroups >=0.18.3 && <0.20
63+ build-depends: semigroups >=0.18.3 && <0.19
6464
6565 hs-source-dirs: src
6666 default-extensions:
src/Servant/QuickCheck/Internal/HasGenRequest.hs+6−9
@@ -63,14 +63,18 @@ instance (KnownSymbol path, HasGenRequest b) => HasGenRequest (path :> b) where
6363 (oldf, old) = genRequest (Proxy :: Proxy b)
6464 new = cs $ symbolVal (Proxy :: Proxy path)
6565
66+#if MIN_VERSION_servant(0,11,0)
6667instance HasGenRequest EmptyAPI where
6768 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
69+#endif
6870
71+#if MIN_VERSION_servant(0,12,0)
6972instance HasGenRequest api => HasGenRequest (Summary d :> api) where
7073 genRequest _ = genRequest (Proxy :: Proxy api)
7174
7275instance HasGenRequest api => HasGenRequest (Description d :> api) where
7376 genRequest _ = genRequest (Proxy :: Proxy api)
77+#endif
7478
7579instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
7680 => HasGenRequest (Capture' mods x c :> b) where
@@ -82,6 +86,7 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
8286 (oldf, old) = genRequest (Proxy :: Proxy b)
8387 new = arbitrary :: Gen c
8488
89+#if MIN_VERSION_servant(0,8,0)
8590instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
8691 => HasGenRequest (CaptureAll x c :> b) where
8792 genRequest _ = (oldf, do
@@ -92,6 +97,7 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
9297 where
9398 (oldf, old) = genRequest (Proxy :: Proxy b)
9499 new = arbitrary :: Gen [c]
100+#endif
95101
96102instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)
97103 => HasGenRequest (Header' mods h c :> b) where
@@ -168,15 +174,6 @@ instance (ReflectMethod method)
168174 , method = reflectMethod (Proxy :: Proxy method)
169175 })
170176
171−instance (ReflectMethod method)
172− => HasGenRequest (NoContentVerb (method :: k)) where
173− genRequest _ = (1, return $ \burl -> defaultRequest
174− { host = cs $ baseUrlHost burl
175− , port = baseUrlPort burl
176− , secure = baseUrlScheme burl == Https
177− , method = reflectMethod (Proxy :: Proxy method)
178− })
179−
180177instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where
181178 genRequest _ = genRequest (Proxy :: Proxy a)
182179
src/Servant/QuickCheck/Internal/QuickCheck.hs−7
@@ -11,9 +11,6 @@ import Network.Wai.Handler.Warp (withApplication)
1111import Prelude.Compat
1212import Servant (Context (EmptyContext), HasServer,
1313 Server, serveWithContext)
14−#if MIN_VERSION_servant_server(0,18,0)
15−import Servant (DefaultErrorFormatters, ErrorFormatters, HasContextEntry, type (.++))
16−#endif
1714import Servant.Client (BaseUrl (..), Scheme (..))
1815import System.IO.Unsafe (unsafePerformIO)
1916import Test.Hspec (Expectation, expectationFailure)
@@ -40,11 +37,7 @@ withServantServer api = withServantServerAndContext api EmptyContext
4037-- application.
4138--
4239-- /Since 0.0.0.0/
43−#if MIN_VERSION_servant_server(0,18,0)
44−withServantServerAndContext :: (HasServer a ctx, HasContextEntry (ctx .++ DefaultErrorFormatters) ErrorFormatters)
45−#else
4640withServantServerAndContext :: HasServer a ctx
47−#endif
4841 => Proxy a -> Context ctx -> IO (Server a) -> (BaseUrl -> IO r) -> IO r
4942withServantServerAndContext api ctx server t
5043 = withApplication (return . serveWithContext api ctx =<< server) $ \port ->