git.iko.soy/servant-quickcheck
on master help sign in
Merge branch 'master' into support-servant-0.15
commiteb3cdbcd3a9a92a28bea830737d3bd8511bba396 authorJulian Arni <jkarni@gmail.com> dateThu 25 Jun 2020, 11:02 (6 years ago) parentbb81779f48088b
6 files changed+91−69
.travis.yml+55−50 CHANGELOG.yaml+5 cabal.haskell-ci+7 cabal.project+2 servant-quickcheck.cabal+13−13 src/Servant/QuickCheck/Internal/HasGenRequest.hs+9−6
.travis.yml+55−50
@@ -1,12 +1,14 @@
11# This Travis job script has been generated by a script via
22#
3−# haskell-ci '--branches' 'master' '-o' '.travis.yml' 'servant-quickcheck.cabal'
3+# haskell-ci '--config=cabal.haskell-ci' 'servant-quickcheck.cabal'
44#
55# For more information, see https://github.com/haskell-CI/haskell-ci
66#
7−# version: 0.3.20190413
7+# version: 0.9.20200121
88#
9+version: ~> 1.0
910language: c
11+os: linux
1012dist: xenial
1113git:
1214 # whether to recursively clone submodules
@@ -18,6 +20,7 @@ cache:
1820 directories:
1921 - $HOME/.cabal/packages
2022 - $HOME/.cabal/store
23+ - $HOME/.hlint
2124before_cache:
2225 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
2326 # remove files that are regenerated by 'cabal update'
@@ -27,67 +30,63 @@ before_cache:
2730 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
2831 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
2932 - rm -rfv $CABALHOME/packages/head.hackage
30−matrix:
33+jobs:
3134 include:
32− - compiler: ghc-8.6.4
33− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.4","cabal-install-2.4"]}}
35+ - compiler: ghc-8.8.1
36+ 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.1","cabal-install-3.0"]}}
37+ os: linux
38+ - compiler: ghc-8.6.5
39+ 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.0"]}}
40+ os: linux
3441 - compiler: ghc-8.4.4
35− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
42+ 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.0"]}}
43+ os: linux
3644 - compiler: ghc-8.2.2
37− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
45+ 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.0"]}}
46+ os: linux
3847 - compiler: ghc-8.0.2
39− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
48+ 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.0"]}}
49+ os: linux
4050before_install:
4151 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
52+ - WITHCOMPILER="-w $HC"
53+ - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
4254 - HCPKG="$HC-pkg"
4355 - unset CC
4456 - CABAL=/opt/ghc/bin/cabal
4557 - CABALHOME=$HOME/.cabal
4658 - export PATH="$CABALHOME/bin:$PATH"
4759 - TOP=$(pwd)
48− - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
60+ - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
4961 - echo $HCNUMVER
50− - CABAL="$CABAL -vnormal+nowrap+markoutput"
62+ - CABAL="$CABAL -vnormal+nowrap"
5163 - 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 '?')]"
7364 - TEST=--enable-tests
7465 - BENCH=--enable-benchmarks
75− - GHCHEAD=${GHCHEAD-false}
66+ - HEADHACKAGE=false
7667 - rm -f $CABALHOME/config
7768 - |
7869 echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
7970 echo "remote-build-reporting: anonymous" >> $CABALHOME/config
71+ echo "write-ghc-environment-files: always" >> $CABALHOME/config
8072 echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
8173 echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
8274 echo "world-file: $CABALHOME/world" >> $CABALHOME/config
8375 echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
8476 echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
77+ echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
8578 echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
8679 echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
8780 echo "install-dirs user" >> $CABALHOME/config
8881 echo " prefix: $CABALHOME" >> $CABALHOME/config
8982 echo "repository hackage.haskell.org" >> $CABALHOME/config
9083 echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
84+install:
85+ - ${CABAL} --version
86+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
87+ - |
88+ echo "program-default-options" >> $CABALHOME/config
89+ echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
9190 - cat $CABALHOME/config
9291 - rm -fv cabal.project cabal.project.local cabal.project.freeze
9392 - travis_retry ${CABAL} v2-update -v
@@ -95,51 +94,57 @@ install:
9594 - rm -rf cabal.project cabal.project.local cabal.project.freeze
9695 - touch cabal.project
9796 - |
98− echo 'packages: "."' >> cabal.project
97+ echo "packages: ." >> cabal.project
9998 - |
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"
99+ - "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"
102100 - cat cabal.project || true
103101 - cat cabal.project.local || true
104102 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
105− - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
103+ - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
106104 - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
107105 - rm cabal.project.freeze
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
106+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
107+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
110108script:
111109 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
112110 # Packaging...
113− - ${CABAL} v2-sdist all | color_cabal_output
111+ - ${CABAL} v2-sdist all
114112 # Unpacking...
115113 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
116114 - cd ${DISTDIR} || false
117− - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
115+ - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
116+ - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
117+ - PKGDIR_servant_quickcheck="$(find . -maxdepth 1 -type d -regex '.*/servant-quickcheck-[0-9.]*')"
118118 # Generate cabal.project
119119 - rm -rf cabal.project cabal.project.local cabal.project.freeze
120120 - touch cabal.project
121121 - |
122− echo 'packages: "servant-quickcheck-*/*.cabal"' >> cabal.project
122+ echo "packages: ${PKGDIR_servant_quickcheck}" >> cabal.project
123123 - |
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"
124+ - "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"
126125 - cat cabal.project || true
127126 - cat cabal.project.local || true
128127 # Building...
129128 # this builds all libraries and executables (without tests/benchmarks)
130− - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
129+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
131130 # Building with tests and benchmarks...
132131 # build & run tests, build benchmarks
133− - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
132+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
134133 # Testing...
135− - ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
134+ - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
136135 # cabal check...
137− - (cd servant-quickcheck-* && ${CABAL} -vnormal check)
136+ - (cd ${PKGDIR_servant_quickcheck} && ${CABAL} -vnormal check)
138137 # haddock...
139− - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
138+ - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
140139 # Building without installed constraints for packages in global-db...
141140 - rm -f cabal.project.local
142− - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
141+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
142+ # Constraint sets
143+ - rm -rf cabal.project.local
144+ # Constraint set base-compat-0.10
145+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.10.*' all
146+ # Constraint set base-compat-0.11
147+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.11.*' all
143148
144−# REGENDATA ["--branches","master","-o",".travis.yml","servant-quickcheck.cabal"]
149+# REGENDATA ("0.9.20200121",["--config=cabal.haskell-ci","servant-quickcheck.cabal"])
145150# EOF
CHANGELOG.yaml+5
@@ -1,4 +1,9 @@
11releases:
2+ - version: "0.0.8.0"
3+ changes:
4+ - description: Support for servant-0.17
5+ authors: phadej
6+ date: 2019-01-23
27
38 - version: "0.0.7.3"
49 changes:
cabal.haskell-cinew file+7
@@ -0,0 +1,7 @@
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.projectnew file+2
@@ -0,0 +1,2 @@
1+packages: .
2+tests: true
servant-quickcheck.cabal+13−13
@@ -1,5 +1,5 @@
11name: servant-quickcheck
2−version: 0.0.7.4
2+version: 0.0.8.0
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.4
16+tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || == 8.8.1
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.13
39− , base-compat-batteries >=0.10.1 && <0.11
38+ , base >=4.9 && <4.15
39+ , base-compat-batteries >=0.10.1 && <0.12
4040 , bytestring >=0.10 && <0.11
4141 , case-insensitive >=1.2 && <1.3
42− , clock >=0.7 && <0.8
42+ , clock >=0.7 && <0.9
4343 , data-default-class >=0.0 && <0.2
4444 , hspec >=2.5.6 && <2.8
45− , http-client >=0.4.30 && <0.7
45+ , http-client >=0.4.30 && <0.8
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.14
52− , servant >=0.15 && <0.17
53− , servant-client >=0.15 && <0.17
54− , servant-server >=0.15 && <0.17
51+ , QuickCheck >=2.7 && <2.15
52+ , servant >=0.15 && <0.18
53+ , servant-client >=0.15 && <0.18
54+ , servant-server >=0.15 && <0.18
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.9
60− , warp >=3.2.4 && <3.3
59+ , time >=1.5 && <1.11
60+ , warp >=3.2.4 && <3.4
6161
6262 if !impl(ghc >=8.0)
63− build-depends: semigroups >=0.18.3 && <0.19
63+ build-depends: semigroups >=0.18.3 && <0.20
6464
6565 hs-source-dirs: src
6666 default-extensions:
src/Servant/QuickCheck/Internal/HasGenRequest.hs+9−6
@@ -63,18 +63,14 @@ 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)
6766instance HasGenRequest EmptyAPI where
6867 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
69−#endif
7068
71−#if MIN_VERSION_servant(0,12,0)
7269instance HasGenRequest api => HasGenRequest (Summary d :> api) where
7370 genRequest _ = genRequest (Proxy :: Proxy api)
7471
7572instance HasGenRequest api => HasGenRequest (Description d :> api) where
7673 genRequest _ = genRequest (Proxy :: Proxy api)
77−#endif
7874
7975instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
8076 => HasGenRequest (Capture' mods x c :> b) where
@@ -86,7 +82,6 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
8682 (oldf, old) = genRequest (Proxy :: Proxy b)
8783 new = arbitrary :: Gen c
8884
89−#if MIN_VERSION_servant(0,8,0)
9085instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
9186 => HasGenRequest (CaptureAll x c :> b) where
9287 genRequest _ = (oldf, do
@@ -97,7 +92,6 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
9792 where
9893 (oldf, old) = genRequest (Proxy :: Proxy b)
9994 new = arbitrary :: Gen [c]
100−#endif
10195
10296instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)
10397 => HasGenRequest (Header' mods h c :> b) where
@@ -174,6 +168,15 @@ instance (ReflectMethod method)
174168 , method = reflectMethod (Proxy :: Proxy method)
175169 })
176170
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+
177180instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where
178181 genRequest _ = genRequest (Proxy :: Proxy a)
179182