Compare commits

..

21 Commits

Author SHA1 Message Date
fisx
0535413b1a
Merge pull request #72 from maksbotan/maksbotan/support-servant-0.18
Support servant-server-0.18
2020-07-31 09:54:59 +02:00
Maxim Koltsov
7cc95a8120
Update src/Servant/QuickCheck/Internal/QuickCheck.hs
Co-authored-by: fisx <mf@zerobuzz.net>
2020-07-31 10:43:19 +03:00
Maxim Koltsov
e1a919127a
haskell-ci regenerate 2020-07-30 19:32:29 +03:00
Maxim Koltsov
e6daf03c16
Support servant-server-0.18 2020-07-30 19:22:14 +03:00
Matthias Fischmann
7926ad6bdb
Fix lower version bounds for servant packages. 2020-07-10 13:54:21 +02:00
Matthias Fischmann
fa9cc11095
Bump version; add changelog entry. 2020-07-02 22:40:04 +02:00
Julian Arni
dfec2529ac
Merge pull request #65 from fizruk/support-servant-0.15
Support servant-0.15
2020-06-25 12:10:58 +02:00
Julian Arni
eb3cdbcd3a
Merge branch 'master' into support-servant-0.15 2020-06-25 11:02:24 +02:00
Julian Arni
f48088b7d2
Merge pull request #70 from felixmulder/relax-constraints-for-GHC-8.10
Relax constraints for GHC 8.10
2020-06-25 11:00:59 +02:00
Felix Mulder
2bf03e822a Relax constraints for GHC 8.10 2020-06-07 09:58:56 +02:00
Oleg Grenrus
092ebe5423
Merge pull request #68 from haskell-servant/servant-0.17
Support servant-0.17
2020-01-24 10:45:48 +02:00
Oleg Grenrus
13d32d6768 Support servant-0.17 2020-01-23 23:38:03 +02:00
Oleg Grenrus
8e8e9b501b Change version back to 0.0.7.4
There are no changes since the tag in the src/
2019-09-16 02:11:42 +03:00
Oleg Grenrus
c93bd5a832
Merge pull request #66 from haskell-servant/updates
Updates: 2019-09
2019-09-16 02:09:26 +03:00
Oleg Grenrus
f9989bbf79 Updates: 2019-09 2019-09-15 18:22:05 +03:00
Nickolay Kudasov
bb8177928e
Support servant-0.15 2019-07-04 11:52:51 +03:00
Oleg Grenrus
f6fb9033e9
Merge pull request #63 from haskell-servant/updates
Support servant-0.16 and http-media-0.8
2019-04-17 12:28:42 +03:00
Oleg Grenrus
804b06283d Update .travis.yml 2019-04-17 11:36:31 +03:00
Oleg Grenrus
a5cdf78d82 Support servant-0.16 and http-media-0.8 2019-04-16 22:19:54 +03:00
Oleg Grenrus
638580ba49
Merge pull request #62 from haskell-servant/servant-0.16
Allow servant-0.16
2019-02-28 00:05:15 +02:00
Oleg Grenrus
8803b1c09e Allow servant-0.16 2019-02-27 20:42:16 +02:00
9 changed files with 283 additions and 220 deletions

View File

@ -1,118 +1,158 @@
# This Travis job script has been generated by a script via # This Travis job script has been generated by a script via
# #
# runghc make_travis_yml_2.hs '--branch' 'master' '-o' '.travis.yml' 'servant-quickcheck.cabal' # haskell-ci '--config=cabal.haskell-ci' 'servant-quickcheck.cabal'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
# #
# For more information, see https://github.com/haskell-CI/haskell-ci # For more information, see https://github.com/haskell-CI/haskell-ci
# #
# version: 0.10.1
#
version: ~> 1.0
language: c language: c
sudo: false os: linux
dist: xenial
git: git:
submodules: false # whether to recursively clone submodules # whether to recursively clone submodules
submodules: false
branches: branches:
only: only:
- master - master
cache: cache:
directories: directories:
- $HOME/.cabal/packages - $HOME/.cabal/packages
- $HOME/.cabal/store - $HOME/.cabal/store
- $HOME/.hlint
before_cache: before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update' # remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.* - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
- rm -rfv $CABALHOME/packages/head.hackage
- rm -rfv $HOME/.cabal/packages/head.hackage jobs:
matrix:
include: include:
- compiler: "ghc-8.6.1" - compiler: ghc-8.8.3
# env: TEST=--disable-tests BENCH=--disable-benchmarks 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"]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}} os: linux
- compiler: "ghc-8.4.4" - compiler: ghc-8.6.5
# env: TEST=--disable-tests BENCH=--disable-benchmarks 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"]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}} os: linux
- compiler: "ghc-8.2.2" - compiler: ghc-8.4.4
# env: TEST=--disable-tests BENCH=--disable-benchmarks 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"]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}} os: linux
- compiler: "ghc-8.0.2" - compiler: ghc-8.2.2
# env: TEST=--disable-tests BENCH=--disable-benchmarks 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"]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}} os: linux
- compiler: "ghc-7.10.3" - compiler: ghc-8.0.2
# env: TEST=--disable-tests BENCH=--disable-benchmarks 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"]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}} os: linux
before_install: before_install:
- HC=${CC} - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
- HCPKG=${HC/ghc/ghc-pkg} - WITHCOMPILER="-w $HC"
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
- HCPKG="$HC-pkg"
- unset CC - unset CC
- ROOTDIR=$(pwd) - CABAL=/opt/ghc/bin/cabal
- mkdir -p $HOME/.local/bin - CABALHOME=$HOME/.cabal
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH" - export PATH="$CABALHOME/bin:$PATH"
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') )) - TOP=$(pwd)
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
- echo $HCNUMVER - echo $HCNUMVER
- CABAL="$CABAL -vnormal+nowrap"
- set -o pipefail
- TEST=--enable-tests
- BENCH=--enable-benchmarks
- HEADHACKAGE=false
- rm -f $CABALHOME/config
- |
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
echo "write-ghc-environment-files: always" >> $CABALHOME/config
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
echo "install-dirs user" >> $CABALHOME/config
echo " prefix: $CABALHOME" >> $CABALHOME/config
echo "repository hackage.haskell.org" >> $CABALHOME/config
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
install: install:
- cabal --version - ${CABAL} --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- BENCH=${BENCH---enable-benchmarks} - |
- TEST=${TEST---enable-tests} echo "program-default-options" >> $CABALHOME/config
- HADDOCK=${HADDOCK-true} echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
- UNCONSTRAINED=${UNCONSTRAINED-true} - cat $CABALHOME/config
- NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false} - rm -fv cabal.project cabal.project.local cabal.project.freeze
- GHCHEAD=${GHCHEAD-false} - travis_retry ${CABAL} v2-update -v
- travis_retry cabal update -v # Generate cabal.project
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config" - rm -rf cabal.project cabal.project.local cabal.project.freeze
- rm -fv cabal.project cabal.project.local - touch cabal.project
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' - |
- "printf 'packages: \".\"\\n' > cabal.project" echo "packages: ." >> cabal.project
- touch cabal.project.local - if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-quickcheck' >> cabal.project ; fi
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant-quickcheck | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" - "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
- |
- "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"
- cat cabal.project || true - cat cabal.project || true
- cat cabal.project.local || true - cat cabal.project.local || true
- if [ -f "./configure.ac" ]; then - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
(cd "." && autoreconf -i); - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
fi - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
- rm -f cabal.project.freeze - rm cabal.project.freeze
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
- rm -rf .ghc.environment.* "."/dist
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
script: script:
# test that source-distributions can be generated - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
- cabal new-sdist all # Packaging...
- ${CABAL} v2-sdist all
# Unpacking...
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/ - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
- cd ${DISTDIR} || false - cd ${DISTDIR} || false
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
- "printf 'packages: servant-quickcheck-*/*.cabal\\n' > cabal.project" - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
- touch cabal.project.local - PKGDIR_servant_quickcheck="$(find . -maxdepth 1 -type d -regex '.*/servant-quickcheck-[0-9.]*')"
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant-quickcheck | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" # Generate cabal.project
- rm -rf cabal.project cabal.project.local cabal.project.freeze
- touch cabal.project
- |
echo "packages: ${PKGDIR_servant_quickcheck}" >> cabal.project
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package servant-quickcheck' >> cabal.project ; fi
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
- |
- "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"
- cat cabal.project || true - cat cabal.project || true
- cat cabal.project.local || true - cat cabal.project.local || true
# Building...
# this builds all libraries and executables (without tests/benchmarks) # this builds all libraries and executables (without tests/benchmarks)
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
# Building with tests and benchmarks...
# build & run tests, build benchmarks # build & run tests, build benchmarks
- cabal new-build -w ${HC} ${TEST} ${BENCH} all - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi # Testing...
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
# cabal check...
- (cd ${PKGDIR_servant_quickcheck} && ${CABAL} -vnormal check)
# haddock...
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
# Building without installed constraints for packages in global-db...
- rm -f cabal.project.local
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
# Constraint sets
- rm -rf cabal.project.local
# Constraint set base-compat-0.10
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.10.*' all
# Constraint set base-compat-0.11
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='base-compat ==0.11.*' all
# cabal check # REGENDATA ("0.10.1",["--config=cabal.haskell-ci","servant-quickcheck.cabal"])
- (cd servant-quickcheck-* && cabal check)
# haddock
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
# Build without installed constraints for packages in global-db
- if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
# REGENDATA ["--branch","master","-o",".travis.yml","servant-quickcheck.cabal"]
# EOF # EOF

View File

@ -1,4 +1,19 @@
releases: releases:
- version: "0.0.9.0"
changes:
- description: "Support servant-0.15 (#65)"
authors: fizruk
date: 2020-06-25
- description: "Relax constraints for GHC 8.10 (#70)"
authors: felixmulder
date: 2020-06-20
- version: "0.0.8.0"
changes:
- description: Support for servant-0.17
authors: phadej
date: 2019-01-23
- version: "0.0.7.3" - version: "0.0.7.3"
changes: changes:

7
cabal.haskell-ci Normal file
View File

@ -0,0 +1,7 @@
branches: master
constraint-set base-compat-0.10
constraints: base-compat ==0.10.*
constraint-set base-compat-0.11
constraints: base-compat ==0.11.*

4
cabal.project Normal file
View File

@ -0,0 +1,4 @@
packages: .
tests: true
allow-newer: servant-blaze:servant

View File

@ -1,29 +1,22 @@
name: servant-quickcheck name: servant-quickcheck
version: 0.0.7.3 version: 0.0.9.1
synopsis: QuickCheck entire APIs synopsis: QuickCheck entire APIs
description: description:
This packages provides QuickCheck properties that are tested across an entire This packages provides QuickCheck properties that are tested across an entire
API. API.
license: BSD3
license-file: LICENSE
author: Julian K. Arni
maintainer: jkarni@gmail.com
category: Web
build-type: Simple
cabal-version: >=1.10
extra-source-files:
CHANGELOG.yaml
tested-with:
GHC ==7.10.3
|| ==8.0.2
|| ==8.2.2
|| ==8.4.4
|| ==8.6.1
license: BSD3
license-file: LICENSE
author: Julian K. Arni
maintainer: jkarni@gmail.com
category: Web
build-type: Simple
cabal-version: >=1.10
extra-source-files: CHANGELOG.yaml
tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || == 8.8.3
source-repository head source-repository head
type: git type: git
location: https://github.com/haskell-servant/servant-quickcheck location: https://github.com/haskell-servant/servant-quickcheck
flag long-tests flag long-tests
@ -31,108 +24,115 @@ flag long-tests
default: False default: False
library library
exposed-modules: Servant.QuickCheck exposed-modules:
, Servant.QuickCheck.Internal Servant.QuickCheck
, Servant.QuickCheck.Internal.Predicates Servant.QuickCheck.Internal
, Servant.QuickCheck.Internal.HasGenRequest Servant.QuickCheck.Internal.Equality
, Servant.QuickCheck.Internal.QuickCheck Servant.QuickCheck.Internal.ErrorTypes
, Servant.QuickCheck.Internal.Equality Servant.QuickCheck.Internal.HasGenRequest
, Servant.QuickCheck.Internal.ErrorTypes Servant.QuickCheck.Internal.Predicates
build-depends: base >=4.8 && <4.13 Servant.QuickCheck.Internal.QuickCheck
, base-compat >= 0.9 && < 0.11
, aeson > 0.8 && < 2
, bytestring == 0.10.*
, case-insensitive == 1.2.*
, clock >= 0.7 && < 0.8
, data-default-class >= 0.0 && < 0.2
, hspec >= 2.5.6 && < 2.6
, http-client >= 0.4.30 && < 0.6 build-depends:
, http-media >= 0.6 && <0.8 aeson >=0.8 && <2
, http-types > 0.8 && < 0.13 , base >=4.9 && <4.15
, mtl > 2.1 && < 2.3 , base-compat-batteries >=0.10.1 && <0.12
, pretty == 1.1.* , bytestring >=0.10 && <0.11
, process >= 1.2 && < 1.7 , case-insensitive >=1.2 && <1.3
, QuickCheck > 2.7 && < 2.13 , clock >=0.7 && <0.9
, servant >= 0.13 && < 0.15 , data-default-class >=0.0 && <0.2
, servant-client >= 0.13 && < 0.15 , hspec >=2.5.6 && <2.8
, servant-server >= 0.13 && < 0.15 , http-client >=0.4.30 && <0.8
, split == 0.2.* , http-media >=0.6 && <0.9
, string-conversions > 0.3 && < 0.5 , http-types >=0.8 && <0.13
, temporary >= 1.2 && <1.4 , mtl >=2.1 && <2.3
, text == 1.* , pretty >=1.1 && <1.2
, time >= 1.5 && < 1.9 , process >=1.2 && <1.7
, warp >= 3.2.4 && < 3.3 , QuickCheck >=2.7 && <2.15
, servant >=0.17 && <0.19
, servant-client >=0.17 && <0.19
, servant-server >=0.17 && <0.19
, split >=0.2 && <0.3
, string-conversions >=0.3 && <0.5
, temporary >=1.2 && <1.4
, text >=1 && <2
, time >=1.5 && <1.11
, warp >=3.2.4 && <3.4
if !impl(ghc >= 8.0) if !impl(ghc >=8.0)
build-depends: build-depends: semigroups >=0.18.3 && <0.20
semigroups >= 0.18.3 && <0.19
hs-source-dirs: src hs-source-dirs: src
default-extensions: TypeOperators default-extensions:
, FlexibleInstances NoImplicitPrelude
, FlexibleContexts ConstraintKinds
, DataKinds DataKinds
, GADTs DeriveDataTypeable
, MultiParamTypeClasses DeriveFunctor
, DeriveFunctor DeriveGeneric
, KindSignatures FlexibleContexts
, RankNTypes FlexibleInstances
, ConstraintKinds FunctionalDependencies
, DeriveGeneric GADTs
, ScopedTypeVariables KindSignatures
, OverloadedStrings MultiParamTypeClasses
, FunctionalDependencies OverloadedStrings
, NoImplicitPrelude RankNTypes
, DeriveDataTypeable ScopedTypeVariables
default-language: Haskell2010 TypeOperators
default-language: Haskell2010
test-suite spec test-suite spec
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
ghc-options: -Wall -threaded ghc-options: -Wall -threaded
default-language: Haskell2010 default-language: Haskell2010
hs-source-dirs: test hs-source-dirs: test
main-is: Spec.hs main-is: Spec.hs
other-modules: Servant.QuickCheck.InternalSpec other-modules: Servant.QuickCheck.InternalSpec
build-tool-depends: hspec-discover:hspec-discover build-tool-depends: hspec-discover:hspec-discover -any
build-depends: base build-depends:
, base-compat aeson
, aeson , base
, servant-quickcheck , base-compat-batteries
, bytestring , blaze-html
, hspec , bytestring
, hspec-core >= 2.5.5 && < 2.6 , hspec
, http-client , hspec-core >=2.5.5 && <2.8
, blaze-html , http-client
, warp , QuickCheck
, servant-server , quickcheck-io
, servant-client , servant
, servant , servant-blaze
, servant-blaze , servant-client
, transformers , servant-quickcheck
, QuickCheck , servant-server
, quickcheck-io , transformers
default-extensions: TypeOperators , warp
, FlexibleInstances
, FlexibleContexts default-extensions:
, GADTs NoImplicitPrelude
, DataKinds DataKinds
, NoImplicitPrelude FlexibleContexts
, OverloadedStrings FlexibleInstances
, ScopedTypeVariables GADTs
OverloadedStrings
ScopedTypeVariables
TypeOperators
if flag(long-tests) if flag(long-tests)
cpp-options: -DLONG_TESTS cpp-options: -DLONG_TESTS
test-suite example test-suite example
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
main-is: Main.hs main-is: Main.hs
hs-source-dirs: hs-source-dirs: example
example ghc-options: -Wall
ghc-options: -Wall
build-depends: build-depends:
base base
, hspec , hspec
, servant-server
, servant-quickcheck , servant-quickcheck
, servant-server
, text , text
default-language: Haskell2010 default-language: Haskell2010

View File

@ -15,8 +15,6 @@ import Servant.API.ContentTypes (AllMimeRender (..))
import Servant.Client (BaseUrl (..), Scheme (..)) import Servant.Client (BaseUrl (..), Scheme (..))
import Test.QuickCheck (Arbitrary (..), Gen, elements, frequency) import Test.QuickCheck (Arbitrary (..), Gen, elements, frequency)
import Data.Monoid ((<>))
import qualified Data.ByteString as BS import qualified Data.ByteString as BS
import qualified Data.ByteString.Internal as BS (c2w) import qualified Data.ByteString.Internal as BS (c2w)
@ -65,18 +63,14 @@ instance (KnownSymbol path, HasGenRequest b) => HasGenRequest (path :> b) where
(oldf, old) = genRequest (Proxy :: Proxy b) (oldf, old) = genRequest (Proxy :: Proxy b)
new = cs $ symbolVal (Proxy :: Proxy path) new = cs $ symbolVal (Proxy :: Proxy path)
#if MIN_VERSION_servant(0,11,0)
instance HasGenRequest EmptyAPI where instance HasGenRequest EmptyAPI where
genRequest _ = (0, error "EmptyAPIs cannot be queried.") genRequest _ = (0, error "EmptyAPIs cannot be queried.")
#endif
#if MIN_VERSION_servant(0,12,0)
instance HasGenRequest api => HasGenRequest (Summary d :> api) where instance HasGenRequest api => HasGenRequest (Summary d :> api) where
genRequest _ = genRequest (Proxy :: Proxy api) genRequest _ = genRequest (Proxy :: Proxy api)
instance HasGenRequest api => HasGenRequest (Description d :> api) where instance HasGenRequest api => HasGenRequest (Description d :> api) where
genRequest _ = genRequest (Proxy :: Proxy api) genRequest _ = genRequest (Proxy :: Proxy api)
#endif
instance (Arbitrary c, HasGenRequest b, ToHttpApiData c ) instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
=> HasGenRequest (Capture' mods x c :> b) where => HasGenRequest (Capture' mods x c :> b) where
@ -88,7 +82,6 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
(oldf, old) = genRequest (Proxy :: Proxy b) (oldf, old) = genRequest (Proxy :: Proxy b)
new = arbitrary :: Gen c new = arbitrary :: Gen c
#if MIN_VERSION_servant(0,8,0)
instance (Arbitrary c, HasGenRequest b, ToHttpApiData c ) instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
=> HasGenRequest (CaptureAll x c :> b) where => HasGenRequest (CaptureAll x c :> b) where
genRequest _ = (oldf, do genRequest _ = (oldf, do
@ -99,7 +92,6 @@ instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
where where
(oldf, old) = genRequest (Proxy :: Proxy b) (oldf, old) = genRequest (Proxy :: Proxy b)
new = arbitrary :: Gen [c] new = arbitrary :: Gen [c]
#endif
instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c) instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)
=> HasGenRequest (Header' mods h c :> b) where => HasGenRequest (Header' mods h c :> b) where
@ -176,6 +168,15 @@ instance (ReflectMethod method)
, method = reflectMethod (Proxy :: Proxy method) , method = reflectMethod (Proxy :: Proxy method)
}) })
instance (ReflectMethod method)
=> HasGenRequest (NoContentVerb (method :: k)) where
genRequest _ = (1, return $ \burl -> defaultRequest
{ host = cs $ baseUrlHost burl
, port = baseUrlPort burl
, secure = baseUrlScheme burl == Https
, method = reflectMethod (Proxy :: Proxy method)
})
instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where instance (HasGenRequest a) => HasGenRequest (RemoteHost :> a) where
genRequest _ = genRequest (Proxy :: Proxy a) genRequest _ = genRequest (Proxy :: Proxy a)

View File

@ -11,6 +11,9 @@ import Network.Wai.Handler.Warp (withApplication)
import Prelude.Compat import Prelude.Compat
import Servant (Context (EmptyContext), HasServer, import Servant (Context (EmptyContext), HasServer,
Server, serveWithContext) Server, serveWithContext)
#if MIN_VERSION_servant_server(0,18,0)
import Servant (DefaultErrorFormatters, ErrorFormatters, HasContextEntry, type (.++))
#endif
import Servant.Client (BaseUrl (..), Scheme (..)) import Servant.Client (BaseUrl (..), Scheme (..))
import System.IO.Unsafe (unsafePerformIO) import System.IO.Unsafe (unsafePerformIO)
import Test.Hspec (Expectation, expectationFailure) import Test.Hspec (Expectation, expectationFailure)
@ -18,7 +21,6 @@ import Test.QuickCheck (Args (..), Result (..), quickCheckWi
import Test.QuickCheck.Monadic (assert, forAllM, monadicIO, monitor, import Test.QuickCheck.Monadic (assert, forAllM, monadicIO, monitor,
run) run)
import Test.QuickCheck.Property (counterexample) import Test.QuickCheck.Property (counterexample)
import Data.Monoid ((<>))
import Servant.QuickCheck.Internal.Equality import Servant.QuickCheck.Internal.Equality
import Servant.QuickCheck.Internal.ErrorTypes import Servant.QuickCheck.Internal.ErrorTypes
@ -38,7 +40,11 @@ withServantServer api = withServantServerAndContext api EmptyContext
-- application. -- application.
-- --
-- /Since 0.0.0.0/ -- /Since 0.0.0.0/
#if MIN_VERSION_servant_server(0,18,0)
withServantServerAndContext :: (HasServer a ctx, HasContextEntry (ctx .++ DefaultErrorFormatters) ErrorFormatters)
#else
withServantServerAndContext :: HasServer a ctx withServantServerAndContext :: HasServer a ctx
#endif
=> Proxy a -> Context ctx -> IO (Server a) -> (BaseUrl -> IO r) -> IO r => Proxy a -> Context ctx -> IO (Server a) -> (BaseUrl -> IO r) -> IO r
withServantServerAndContext api ctx server t withServantServerAndContext api ctx server t
= withApplication (return . serveWithContext api ctx =<< server) $ \port -> = withApplication (return . serveWithContext api ctx =<< server) $ \port ->

View File

@ -1,4 +1,4 @@
resolver: lts-11.13 resolver: nightly-2018-09-03
packages: packages:
- '.' - '.'
extra-deps: extra-deps:

View File

@ -23,12 +23,7 @@ import Test.QuickCheck.Gen (generate, unGen)
import Test.QuickCheck.Random (mkQCGen) import Test.QuickCheck.Random (mkQCGen)
#if MIN_VERSION_servant(0,8,0) import Servant.Test.ComprehensiveAPI (comprehensiveAPIWithoutStreamingOrRaw)
import Servant.API.Internal.Test.ComprehensiveAPI (comprehensiveAPIWithoutRaw)
#else
import Servant.API.Internal.Test.ComprehensiveAPI (ComprehensiveAPI,
comprehensiveAPI)
#endif
import Servant.QuickCheck import Servant.QuickCheck
import Servant.QuickCheck.Internal (genRequest, runGenRequest, import Servant.QuickCheck.Internal (genRequest, runGenRequest,
@ -154,7 +149,7 @@ isComprehensiveSpec :: Spec
isComprehensiveSpec = describe "HasGenRequest" $ do isComprehensiveSpec = describe "HasGenRequest" $ do
it "has instances for all 'servant' combinators" $ do it "has instances for all 'servant' combinators" $ do
let _g = genRequest comprehensiveAPIWithoutRaw let _g = genRequest comprehensiveAPIWithoutStreamingOrRaw
True `shouldBe` True -- This is a type-level check True `shouldBe` True -- This is a type-level check
deepPathSpec :: Spec deepPathSpec :: Spec
@ -374,8 +369,3 @@ noOfTestCases = 20000
#else #else
noOfTestCases = 1000 noOfTestCases = 1000
#endif #endif
#if !MIN_VERSION_servant(0,8,0)
comprehensiveAPIWithoutRaw :: Proxy ComprehensiveAPI
comprehensiveAPIWithoutRaw = comprehensiveAPI
#endif