Skip to content

Commit dce58c1

Browse files
authored
Merge pull request #307 from phadej/doctest-ci
Run doctest on CI
2 parents be54b46 + fafa63a commit dce58c1

File tree

7 files changed

+35
-21
lines changed

7 files changed

+35
-21
lines changed

.travis.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.10.1
11+
# version: 0.11.20201125
1212
#
1313
version: ~> 1.0
1414
language: c
@@ -17,6 +17,9 @@ dist: xenial
1717
git:
1818
# whether to recursively clone submodules
1919
submodules: false
20+
branches:
21+
only:
22+
- master
2023
cache:
2124
directories:
2225
- $HOME/.cabal/packages
@@ -33,41 +36,41 @@ before_cache:
3336
- rm -rfv $CABALHOME/packages/head.hackage
3437
jobs:
3538
include:
36-
- compiler: ghc-8.10.1
37-
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.10.1","cabal-install-3.2"]}}
39+
- compiler: ghc-8.10.2
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.10.2","cabal-install-3.4"]}}
3841
os: linux
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"]}}
42+
- compiler: ghc-8.8.4
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.8.4","cabal-install-3.4"]}}
4144
os: linux
4245
- 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"]}}
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.6.5","cabal-install-3.4"]}}
4447
os: linux
4548
- 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"]}}
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.4.4","cabal-install-3.4"]}}
4750
os: linux
4851
- 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"]}}
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.2.2","cabal-install-3.4"]}}
5053
os: linux
5154
- 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"]}}
55+
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.4"]}}
5356
os: linux
5457
- compiler: ghc-7.10.3
55-
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-7.10.3","cabal-install-3.2"]}}
58+
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-7.10.3","cabal-install-3.4"]}}
5659
os: linux
5760
- compiler: ghc-7.8.4
58-
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-7.8.4","cabal-install-3.2"]}}
61+
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-7.8.4","cabal-install-3.4"]}}
5962
os: linux
6063
- compiler: ghc-7.6.3
61-
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-7.6.3","cabal-install-3.2"]}}
64+
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-7.6.3","cabal-install-3.4"]}}
6265
os: linux
6366
- compiler: ghc-7.4.2
64-
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-7.4.2","cabal-install-3.2"]}}
67+
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-7.4.2","cabal-install-3.4"]}}
6568
os: linux
6669
- compiler: ghc-7.2.2
67-
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-7.2.2","cabal-install-3.2"]}}
70+
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-7.2.2","cabal-install-3.4"]}}
6871
os: linux
6972
- compiler: ghc-7.0.4
70-
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-7.0.4","cabal-install-3.2"]}}
73+
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-7.0.4","cabal-install-3.4"]}}
7174
os: linux
7275
before_install:
7376
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
@@ -113,6 +116,7 @@ install:
113116
- cat $CABALHOME/config
114117
- rm -fv cabal.project cabal.project.local cabal.project.freeze
115118
- travis_retry ${CABAL} v2-update -v
119+
- if [ $HCNUMVER -ge 80000 ] ; then ${CABAL} v2-install $WITHCOMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.17' ; fi
116120
# Generate cabal.project
117121
- rm -rf cabal.project cabal.project.local cabal.project.freeze
118122
- touch cabal.project
@@ -180,7 +184,9 @@ script:
180184
# build & run tests, build benchmarks
181185
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
182186
# Testing...
183-
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
187+
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all --test-show-details=direct
188+
# Doctest...
189+
- if [ $HCNUMVER -ge 80000 ] ; then (cd ${PKGDIR_text} && doctest -fobject-code -DINTEGER_GMP -XNondecreasingIndentation src) ; fi
184190
# cabal check...
185191
- (cd ${PKGDIR_text} && ${CABAL} -vnormal check)
186192
- (cd ${PKGDIR_text_tests} && ${CABAL} -vnormal check)
@@ -192,5 +198,5 @@ script:
192198
- rm -f cabal.project.local
193199
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
194200

195-
# REGENDATA ("0.10.1",["--config=cabal.haskell-ci","cabal.project"])
201+
# REGENDATA ("0.11.20201125",["--config=cabal.haskell-ci","cabal.project"])
196202
# EOF

benchmarks/text-benchmarks.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ author: Jasper Van der Jeugt <[email protected]>,
1313
maintainer: [email protected]
1414
category: Text
1515
build-type: Simple
16-
tested-with: GHC==8.10.1, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4,
16+
tested-with: GHC==8.10.2, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4,
1717
GHC==8.2.2, GHC==8.0.2, GHC==7.10.3
1818

1919
extra-source-files:

cabal.haskell-ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
benchmarks: >=7.4
22
jobs-selection: any
3+
doctest: True
4+
doctest-options: -fobject-code -DINTEGER_GMP
5+
branches: master
36

47
installed: +all -text -parsec
58
install-dependencies: False

src/Data/Text.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ import qualified Language.Haskell.TH.Syntax as TH
259259
import Text.Printf (PrintfArg, formatArg, formatString)
260260
#endif
261261

262+
-- $setup
263+
-- >>> import Data.Text
264+
-- >>> import qualified Data.Text as T
265+
-- >>> :seti -XOverloadedStrings
266+
262267
-- $character_definition
263268
--
264269
-- This package uses the term /character/ to denote Unicode /code points/.

tests/text-tests.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ maintainer: Bryan O'Sullivan <[email protected]>, Herbert Valerio Riedel <h
5656
copyright: 2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper
5757
category: Data, Text
5858
build-type: Simple
59-
tested-with: GHC==8.10.1, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4,
59+
tested-with: GHC==8.10.2, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4,
6060
GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4,
6161
GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
6262
extra-source-files:

text.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ maintainer: Bryan O'Sullivan <[email protected]>, Herbert Valerio Riedel <h
5656
copyright: 2009-2011 Bryan O'Sullivan, 2008-2009 Tom Harper
5757
category: Data, Text
5858
build-type: Simple
59-
tested-with: GHC==8.10.1, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4,
59+
tested-with: GHC==8.10.2, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4,
6060
GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4,
6161
GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
6262
extra-source-files:

th-tests/th-tests.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description:
1010
license: BSD-2-Clause
1111
license-file: LICENSE
1212
category: Text
13-
tested-with: GHC==8.10.1, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4,
13+
tested-with: GHC==8.10.2, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4,
1414
GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4,
1515
GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
1616

0 commit comments

Comments
 (0)