git.iko.soy/servant-quickcheck
on master help sign in
Merge pull request #63 from haskell-servant/updates
f6fb903Oleg Grenrus
.travis.yml+87−63
@@ -4,21 +4,20 @@
4#
4#
5# For more information, see https://github.com/haskell-CI/haskell-ci
5# For more information, see https://github.com/haskell-CI/haskell-ci
6#
6#
7+# version: 0.3.20190413
8+#
7language: c
9language: c
8dist: xenial
10dist: xenial
9−
10git:
11git:
11− submodules: false # whether to recursively clone submodules
12+ # whether to recursively clone submodules
12−
13+ submodules: false
13branches:
14branches:
14 only:
15 only:
15 - master
16 - master
16−
17cache:
17cache:
18 directories:
18 directories:
19 - $HOME/.cabal/packages
19 - $HOME/.cabal/packages
20 - $HOME/.cabal/store
20 - $HOME/.cabal/store
21−
22before_cache:
21before_cache:
23 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
22 - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
24 # remove files that are regenerated by 'cabal update'
23 # remove files that are regenerated by 'cabal update'
@@ -27,95 +26,120 @@ before_cache:
27 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
26 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
28 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
27 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
29 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
28 - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
30−
31 - rm -rfv $CABALHOME/packages/head.hackage
29 - rm -rfv $CABALHOME/packages/head.hackage
32−
33matrix:
30matrix:
34 include:
31 include:
35− - compiler: "ghc-8.6.3"
32+ - compiler: ghc-8.6.4
36− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}}
33+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.4","cabal-install-2.4"]}}
37− - compiler: "ghc-8.4.4"
34+ - compiler: ghc-8.4.4
38− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
35+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
39− - compiler: "ghc-8.2.2"
36+ - compiler: ghc-8.2.2
40− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
37+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
41− - compiler: "ghc-8.0.2"
38+ - compiler: ghc-8.0.2
42− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
39+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
43− - compiler: "ghc-7.10.3"
44− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
45−
46before_install:
40before_install:
47− - HC=/opt/ghc/bin/${CC}
41+ - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
48− - HCVER=$(echo "$TRAVIS_COMPILER" | sed 's/ghc-//')
49− - echo $HCVER
50− - HCPKG=${HC/ghc/ghc-pkg}
42+ - HCPKG="$HC-pkg"
51 - unset CC
43 - unset CC
52 - CABAL=/opt/ghc/bin/cabal
44 - CABAL=/opt/ghc/bin/cabal
53 - CABALHOME=$HOME/.cabal
45 - CABALHOME=$HOME/.cabal
54 - export PATH="$CABALHOME/bin:$PATH"
46 - export PATH="$CABALHOME/bin:$PATH"
55− - ROOTDIR=$(pwd)
47+ - TOP=$(pwd)
56 - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
48 - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
57 - echo $HCNUMVER
49 - echo $HCNUMVER
58−
50+ - CABAL="$CABAL -vnormal+nowrap+markoutput"
51+ - 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
59install:
70install:
60 - ${CABAL} --version
71 - ${CABAL} --version
61 - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
72 - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
62 - TEST=--enable-tests
73 - TEST=--enable-tests
63 - BENCH=--enable-benchmarks
74 - BENCH=--enable-benchmarks
64 - GHCHEAD=${GHCHEAD-false}
75 - GHCHEAD=${GHCHEAD-false}
65− - if [ "$TRAVIS_OS_NAME" = "windows" ]; then export CABALHOME=$APPDATA/cabal; else export CABALHOME=$HOME/.cabal; fi
76+ - rm -f $CABALHOME/config
77+ - |
78+ echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
79+ echo "remote-build-reporting: anonymous" >> $CABALHOME/config
80+ echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
81+ echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
82+ echo "world-file: $CABALHOME/world" >> $CABALHOME/config
83+ echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
84+ echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
85+ echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
86+ echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
87+ echo "install-dirs user" >> $CABALHOME/config
88+ echo " prefix: $CABALHOME" >> $CABALHOME/config
89+ echo "repository hackage.haskell.org" >> $CABALHOME/config
90+ echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
91+ - cat $CABALHOME/config
92+ - rm -fv cabal.project cabal.project.local cabal.project.freeze
66− - travis_retry ${CABAL} update -v
93+ - travis_retry ${CABAL} v2-update -v
67− - sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
94+ # Generate cabal.project
68− - rm -fv cabal.project cabal.project.local
95+ - rm -rf cabal.project cabal.project.local cabal.project.freeze
69− - grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
70− - rm -f cabal.project
71 - touch cabal.project
96 - touch cabal.project
97+ - |
72− - "printf 'packages: \".\"\\n' >> cabal.project"
98+ echo 'packages: "."' >> cabal.project
99+ - |
73− - "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
100+ echo "write-ghc-environment-files: always" >> cabal.project
74− - touch cabal.project.local
75 - "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"
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"
76 - cat cabal.project || true
102 - cat cabal.project || true
77 - cat cabal.project.local || true
103 - cat cabal.project.local || true
78 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
104 - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
79− - rm -f cabal.project.freeze
80− - ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
105+ - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
81− - "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
106+ - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
82− - rm "cabal.project.freeze"
107+ - rm cabal.project.freeze
83− - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
108+ - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output
84− - ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
109+ - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output
85− - rm -rf .ghc.environment.* "."/dist
86− - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
87−
88−# Here starts the actual work to be performed for the package under test;
89−# any command which exits with a non-zero exit code causes the build to fail.
90script:
110script:
91− # test that source-distributions can be generated
111+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
112+ # Packaging...
92− - ${CABAL} new-sdist all
113+ - ${CABAL} v2-sdist all | color_cabal_output
114+ # Unpacking...
93 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
115 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
94 - cd ${DISTDIR} || false
116 - cd ${DISTDIR} || false
95 - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
117 - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
118+ # Generate cabal.project
96− - rm -f cabal.project
119+ - rm -rf cabal.project cabal.project.local cabal.project.freeze
97 - touch cabal.project
120 - touch cabal.project
121+ - |
98− - "printf 'packages: \"servant-quickcheck-*/*.cabal\"\\n' >> cabal.project"
122+ echo 'packages: "servant-quickcheck-*/*.cabal"' >> cabal.project
123+ - |
99− - "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
124+ echo "write-ghc-environment-files: always" >> cabal.project
100− - touch cabal.project.local
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"
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"
102 - cat cabal.project || true
126 - cat cabal.project || true
103 - cat cabal.project.local || true
127 - cat cabal.project.local || true
128+ # Building...
104 # this builds all libraries and executables (without tests/benchmarks)
129 # this builds all libraries and executables (without tests/benchmarks)
105− - ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
130+ - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
106−
131+ # Building with tests and benchmarks...
107 # build & run tests, build benchmarks
132 # build & run tests, build benchmarks
108− - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
133+ - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
134+ # Testing...
109− - if [ "x$TEST" = "x--enable-tests" ]; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all; fi
135+ - ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
110−
111− # cabal check
136+ # cabal check...
112− - (cd servant-quickcheck-* && ${CABAL} check)
137+ - (cd servant-quickcheck-* && ${CABAL} -vnormal check)
113−
114− # haddock
138+ # haddock...
115− - ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
139+ - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
116−
117− # Build without installed constraints for packages in global-db
140+ # Building without installed constraints for packages in global-db...
141+ - rm -f cabal.project.local
118− - rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all;
142+ - ${CABAL} v2-build -w ${HC} --disable-tests --disable-benchmarks all | color_cabal_output
119
143
120# REGENDATA ["--branches","master","-o",".travis.yml","servant-quickcheck.cabal"]
144# REGENDATA ["--branches","master","-o",".travis.yml","servant-quickcheck.cabal"]
121# EOF
145# EOF
servant-quickcheck.cabal+8−8
@@ -1,5 +1,5 @@
1name: servant-quickcheck
1name: servant-quickcheck
2−version: 0.0.7.3
2+version: 0.0.7.4
3synopsis: QuickCheck entire APIs
3synopsis: QuickCheck entire APIs
4description:
4description:
5 This packages provides QuickCheck properties that are tested across an entire
5 This packages provides QuickCheck properties that are tested across an entire
@@ -13,7 +13,7 @@ category: Web
13build-type: Simple
13build-type: Simple
14cabal-version: >=1.10
14cabal-version: >=1.10
15extra-source-files: CHANGELOG.yaml
15extra-source-files: CHANGELOG.yaml
16−tested-with: GHC ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.3
16+tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.4
17
17
18source-repository head
18source-repository head
19 type: git
19 type: git
@@ -35,7 +35,7 @@ library
35
35
36 build-depends:
36 build-depends:
37 aeson >=0.8 && <2
37 aeson >=0.8 && <2
38− , base >=4.8 && <4.13
38+ , base >=4.9 && <4.13
39 , base-compat-batteries >=0.10.1 && <0.11
39 , base-compat-batteries >=0.10.1 && <0.11
40 , bytestring >=0.10 && <0.11
40 , bytestring >=0.10 && <0.11
41 , case-insensitive >=1.2 && <1.3
41 , case-insensitive >=1.2 && <1.3
@@ -43,15 +43,15 @@ library
43 , data-default-class >=0.0 && <0.2
43 , data-default-class >=0.0 && <0.2
44 , hspec >=2.5.6 && <2.8
44 , hspec >=2.5.6 && <2.8
45 , http-client >=0.4.30 && <0.7
45 , http-client >=0.4.30 && <0.7
46− , http-media >=0.6 && <0.8
46+ , http-media >=0.6 && <0.9
47 , http-types >=0.8 && <0.13
47 , http-types >=0.8 && <0.13
48 , mtl >=2.1 && <2.3
48 , mtl >=2.1 && <2.3
49 , pretty >=1.1 && <1.2
49 , pretty >=1.1 && <1.2
50 , process >=1.2 && <1.7
50 , process >=1.2 && <1.7
51− , QuickCheck >=2.7 && <2.13
51+ , QuickCheck >=2.7 && <2.14
52− , servant >=0.13 && <0.15
52+ , servant >=0.16 && <0.17
53− , servant-client >=0.13 && <0.15
53+ , servant-client >=0.16 && <0.17
54− , servant-server >=0.13 && <0.15
54+ , servant-server >=0.16 && <0.17
55 , split >=0.2 && <0.3
55 , split >=0.2 && <0.3
56 , string-conversions >=0.3 && <0.5
56 , string-conversions >=0.3 && <0.5
57 , temporary >=1.2 && <1.4
57 , temporary >=1.2 && <1.4
test/Servant/QuickCheck/InternalSpec.hs+2−12
@@ -23,12 +23,7 @@ import Test.QuickCheck.Gen (generate, unGen)
23import Test.QuickCheck.Random (mkQCGen)
23import Test.QuickCheck.Random (mkQCGen)
24
24
25
25
26−#if MIN_VERSION_servant(0,8,0)
27−import Servant.API.Internal.Test.ComprehensiveAPI (comprehensiveAPIWithoutRaw)
26+import Servant.Test.ComprehensiveAPI (comprehensiveAPIWithoutStreamingOrRaw)
28−#else
29−import Servant.API.Internal.Test.ComprehensiveAPI (ComprehensiveAPI,
30− comprehensiveAPI)
31−#endif
32
27
33import Servant.QuickCheck
28import Servant.QuickCheck
34import Servant.QuickCheck.Internal (genRequest, runGenRequest,
29import Servant.QuickCheck.Internal (genRequest, runGenRequest,
@@ -154,7 +149,7 @@ isComprehensiveSpec :: Spec
154isComprehensiveSpec = describe "HasGenRequest" $ do
149isComprehensiveSpec = describe "HasGenRequest" $ do
155
150
156 it "has instances for all 'servant' combinators" $ do
151 it "has instances for all 'servant' combinators" $ do
157− let _g = genRequest comprehensiveAPIWithoutRaw
152+ let _g = genRequest comprehensiveAPIWithoutStreamingOrRaw
158 True `shouldBe` True -- This is a type-level check
153 True `shouldBe` True -- This is a type-level check
159
154
160deepPathSpec :: Spec
155deepPathSpec :: Spec
@@ -374,8 +369,3 @@ noOfTestCases = 20000
374#else
369#else
375noOfTestCases = 1000
370noOfTestCases = 1000
376#endif
371#endif
377−
378−#if !MIN_VERSION_servant(0,8,0)
379−comprehensiveAPIWithoutRaw :: Proxy ComprehensiveAPI
380−comprehensiveAPIWithoutRaw = comprehensiveAPI
381−#endif