Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

.travis.yml: stolen from thyme and merged; fix hlint warnings

  • Loading branch information...
commit a6bf6dc13c94475f5f5e14dfe275df16300800bf 1 parent 65d5609
@liyang liyang authored
View
5 .travis.hlint
@@ -0,0 +1,5 @@
+#! /bin/bash
+
+SRC="$(sed -ne 's/^\W*hs-source-dirs:\W*\(.*\)$/\1/p' *.cabal)"
+hlint --cpp-simple -i "Use camelCase" -i "Reduce duplication" ${SRC:-.}
+
View
28 .travis.install-deps
@@ -0,0 +1,28 @@
+#! /bin/bash
+set -eu
+
+APT="sudo apt-get -q -y"
+CABAL_INSTALL_DEPS="cabal install --only-dependencies"
+
+$APT install dctrl-tools
+cabal update
+
+# Find potential system packages to satisfy cabal dependencies
+deps()
+{
+ local M='^\([^ ]\+\)-[0-9.]\+ .*$'
+ local G=' -o ( -FPackage -X libghc-\L\1\E-dev )'
+ local Q="s/QuickCheck/&2/" # QuickCheck is special
+ local E="$($CABAL_INSTALL_DEPS "$@" --dry-run -v 2> /dev/null \
+ | sed -ne "$Q; s/$M/$G/p" | sort -u)"
+ grep-aptavail -n -sPackage \( -FNone -X None \) $E | sort -u
+}
+
+$APT install $(deps "$@")
+$CABAL_INSTALL_DEPS "$@" # Install the rest via Hackage
+
+if ! $APT install hlint ; then
+ $APT install $(deps hlint)
+ cabal install hlint
+fi
+
View
17 .travis.yml
@@ -1,6 +1,19 @@
language: haskell
+
before_install:
- - "cabal install test-framework-hunit"
- - "cabal install test-framework-th"
+ - ./.travis.install-deps $mode --constraint="bytestring installed" --constraint="template-haskell == 2.7.0.0" --force-reinstalls
+
+install:
+ - cabal configure $mode
+ - cabal build
+
+script:
+ - cabal test --show-details=always
+ - ./.travis.hlint
+
+env:
+ - mode="-fWerror --enable-tests"
+
notifications:
email: false
+
View
2  tests/Test/Collection.hs
@@ -23,7 +23,7 @@ case_switchCollection = do
col <- switchD colD
(_, updates) <- openCollection col
listS <- discreteToSignal $ collectionToDiscreteList col
- return $ (,) <$> listS <*> (eventToSignal updates)
+ return $ (,) <$> listS <*> eventToSignal updates
result @?=
[ ([(0, 10)]
, [])
View
5 tests/Test/Update.hs
@@ -29,9 +29,8 @@ case_startUpdateNetwork = do
case_skip :: Assertion
case_skip = do
- (sample, step) <- startUpdateNetwork $ do
- update <- updateUseLast <$> eventFromList [[1], [2, 3], [], [4::Int]]
- return $ update
+ (sample, step) <- startUpdateNetwork $
+ updateUseLast <$> eventFromList [[1], [2, 3], [], [4::Int]]
step
val0 <- sample
val1 <- sample
Please sign in to comment.
Something went wrong with that request. Please try again.