Merge remote-tracking branch 'origin/fix-doctests'
This commit is contained in:
commit
8412ea96fb
48
.travis.yml
48
.travis.yml
@ -7,18 +7,18 @@ dist: trusty
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- env: CABALVER=2.2 GHCVER=7.6.3
|
- env: CABALVER=3.0 GHCVER=7.10.3 SKIP_DOCTESTS=yes
|
||||||
addons: {apt: {packages: [cabal-install-2.2,ghc-7.6.3], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [cabal-install-3.0,ghc-7.10.3], sources: [hvr-ghc]}}
|
||||||
- env: CABALVER=2.2 GHCVER=7.8.4
|
- env: CABALVER=3.0 GHCVER=8.0.2 SKIP_DOCTESTS=yes
|
||||||
addons: {apt: {packages: [cabal-install-2.2,ghc-7.8.4], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [cabal-install-3.0,ghc-8.0.2], sources: [hvr-ghc]}}
|
||||||
- env: CABALVER=2.2 GHCVER=7.10.2
|
- env: CABALVER=3.0 GHCVER=8.2.2
|
||||||
addons: {apt: {packages: [cabal-install-2.2,ghc-7.10.2], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [cabal-install-3.0,ghc-8.2.2], sources: [hvr-ghc]}}
|
||||||
- env: CABALVER=2.2 GHCVER=8.0.1
|
- env: CABALVER=3.0 GHCVER=8.4.4
|
||||||
addons: {apt: {packages: [cabal-install-2.2,ghc-8.0.1], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [cabal-install-3.0,ghc-8.4.4], sources: [hvr-ghc]}}
|
||||||
- env: CABALVER=2.2 GHCVER=8.2.2
|
- env: CABALVER=3.0 GHCVER=8.6.5
|
||||||
addons: {apt: {packages: [cabal-install-2.2,ghc-8.2.2], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [cabal-install-3.0,ghc-8.6.5], sources: [hvr-ghc]}}
|
||||||
- env: CABALVER=2.2 GHCVER=8.4.1
|
- env: CABALVER=3.0 GHCVER=8.8.1
|
||||||
addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.1], sources: [hvr-ghc]}}
|
||||||
- env: CABALVER=head GHCVER=head
|
- env: CABALVER=head GHCVER=head
|
||||||
addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
|
||||||
|
|
||||||
@ -31,32 +31,22 @@ env:
|
|||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get install -y hscolour
|
- sudo apt-get install -y hscolour
|
||||||
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
|
- export PATH=~/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- cabal --version
|
- cabal --version
|
||||||
- travis_retry cabal update
|
- travis_retry cabal update
|
||||||
- cabal sandbox init
|
- cabal install --installdir=$HOME/.cabal/bin hspec-discover
|
||||||
- cabal install --only-dependencies --enable-tests -j
|
- cabal install --installdir=$HOME/.cabal/bin doctest
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- cabal configure --enable-tests -v2
|
- cabal build --enable-tests
|
||||||
- cabal build
|
|
||||||
- cabal test
|
- cabal test
|
||||||
|
- ./run-doctests.sh
|
||||||
- cabal check
|
- cabal check
|
||||||
- cabal sdist
|
- cabal sdist
|
||||||
- cabal haddock --hyperlink-source --html-location=https://hackage.haskell.org/package/\$pkg-\$version/docs/
|
- cabal haddock --haddock-hyperlink-source --haddock-html-location=https://hackage.haskell.org/package/\$pkg-\$version/docs/
|
||||||
# check that the generated source-distribution can be built & installed
|
- cabal install --lib
|
||||||
- export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
|
|
||||||
cd dist/;
|
|
||||||
cabal sandbox init;
|
|
||||||
if [ -f "$SRC_TGZ" ]; then
|
|
||||||
cabal install "$SRC_TGZ" --enable-tests;
|
|
||||||
else
|
|
||||||
echo "expected '$SRC_TGZ' not found";
|
|
||||||
exit 1;
|
|
||||||
fi;
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- ./update-gh-pages.sh
|
- ./update-gh-pages.sh
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
module Main where
|
|
||||||
|
|
||||||
|
|
||||||
import Test.DocTest
|
|
||||||
import Test.HUnit
|
|
||||||
|
|
||||||
main =
|
|
||||||
doctest
|
|
||||||
["-isrc"
|
|
||||||
, "-XOverloadedStrings"
|
|
||||||
, "src/HPath.hs"
|
|
||||||
]
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
{-# LANGUAGE OverloadedStrings #-}
|
|
||||||
|
|
||||||
module Main where
|
|
||||||
|
|
||||||
import Control.Applicative
|
|
||||||
import System.Posix.Directory.Traversals
|
|
||||||
|
|
||||||
import Test.DocTest
|
|
||||||
import Test.HUnit
|
|
||||||
|
|
||||||
main = do
|
|
||||||
doctest
|
|
||||||
[ "-isrc"
|
|
||||||
, "-XOverloadedStrings"
|
|
||||||
, "System.Posix.FilePath"
|
|
||||||
]
|
|
||||||
runTestTT unitTests
|
|
||||||
|
|
||||||
|
|
||||||
unitTests :: Test
|
|
||||||
unitTests = test
|
|
||||||
[ TestCase $ do
|
|
||||||
r <- (==) <$> allDirectoryContents "." <*> allDirectoryContents' "."
|
|
||||||
assertBool "allDirectoryContents == allDirectoryContents'" r
|
|
||||||
]
|
|
42
hpath.cabal
42
hpath.cabal
@ -10,11 +10,15 @@ copyright: Julian Ospald 2016
|
|||||||
category: Filesystem
|
category: Filesystem
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
cabal-version: 1.14
|
cabal-version: 1.14
|
||||||
|
tested-with: GHC==7.10.3
|
||||||
|
, GHC==8.0.2
|
||||||
|
, GHC==8.2.2
|
||||||
|
, GHC==8.4.4
|
||||||
|
, GHC==8.6.5
|
||||||
|
, GHC==8.8.1
|
||||||
extra-source-files: README.md
|
extra-source-files: README.md
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
cbits/dirutils.h
|
cbits/dirutils.h
|
||||||
doctests-hpath.hs
|
|
||||||
doctests-posix.hs
|
|
||||||
|
|
||||||
library
|
library
|
||||||
if os(windows)
|
if os(windows)
|
||||||
@ -35,13 +39,12 @@ library
|
|||||||
System.Posix.FD,
|
System.Posix.FD,
|
||||||
System.Posix.FilePath
|
System.Posix.FilePath
|
||||||
other-modules: HPath.Internal
|
other-modules: HPath.Internal
|
||||||
build-depends: base >= 4.6 && <5
|
build-depends: base >= 4.8 && <5
|
||||||
, IfElse
|
, IfElse
|
||||||
, bytestring >= 0.10.0.0
|
, bytestring >= 0.10.0.0
|
||||||
, deepseq
|
, deepseq
|
||||||
, exceptions
|
, exceptions
|
||||||
, hspec
|
, hspec
|
||||||
, simple-sendfile >= 0.2.24
|
|
||||||
, streamly >= 0.7
|
, streamly >= 0.7
|
||||||
, unix >= 2.5
|
, unix >= 2.5
|
||||||
, unix-bytestring
|
, unix-bytestring
|
||||||
@ -49,37 +52,6 @@ library
|
|||||||
, word8
|
, word8
|
||||||
|
|
||||||
|
|
||||||
test-suite doctests-hpath
|
|
||||||
if os(windows)
|
|
||||||
build-depends: unbuildable<0
|
|
||||||
buildable: False
|
|
||||||
default-language: Haskell2010
|
|
||||||
type: exitcode-stdio-1.0
|
|
||||||
ghc-options: -threaded
|
|
||||||
main-is: doctests-hpath.hs
|
|
||||||
build-depends: base
|
|
||||||
, HUnit
|
|
||||||
, QuickCheck
|
|
||||||
, doctest >= 0.8
|
|
||||||
, hpath
|
|
||||||
|
|
||||||
test-suite doctests-posix
|
|
||||||
if os(windows)
|
|
||||||
build-depends: unbuildable<0
|
|
||||||
buildable: False
|
|
||||||
default-language: Haskell2010
|
|
||||||
type: exitcode-stdio-1.0
|
|
||||||
ghc-options: -threaded
|
|
||||||
main-is: doctests-posix.hs
|
|
||||||
build-depends: base,
|
|
||||||
bytestring >= 0.10.0.0,
|
|
||||||
unix,
|
|
||||||
hpath,
|
|
||||||
doctest >= 0.8,
|
|
||||||
HUnit,
|
|
||||||
QuickCheck,
|
|
||||||
word8
|
|
||||||
|
|
||||||
test-suite spec
|
test-suite spec
|
||||||
if os(windows)
|
if os(windows)
|
||||||
build-depends: unbuildable<0
|
build-depends: unbuildable<0
|
||||||
|
22
run-doctests.sh
Executable file
22
run-doctests.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -n "${SKIP_DOCTESTS}" ] ; then
|
||||||
|
echo "Skipping doctests"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v doctest >/dev/null ; then
|
||||||
|
tempdir="$(mktemp -d)"
|
||||||
|
(
|
||||||
|
cd "${tempdir}"
|
||||||
|
cabal install --installdir="${tempdir}" doctest
|
||||||
|
)
|
||||||
|
export PATH="${tempdir}:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
cabal exec doctest -- -isrc -XOverloadedStrings System.Posix.FilePath
|
||||||
|
cabal exec doctest -- -isrc -XOverloadedStrings HPath
|
Loading…
Reference in New Issue
Block a user