sign 0.4.2 → 0.4.3
raw patch · 6 files changed
+103/−56 lines, 6 filesdep ~tasty-hunitdep ~tasty-quickcheck
Dependency ranges changed: tasty-hunit, tasty-quickcheck
Files
- .travis.yml +66/−52
- CHANGELOG.markdown +4/−0
- README.md +1/−1
- appveyor.yml +21/−0
- sign.cabal +3/−2
- test/TestSign.hs +8/−1
.travis.yml view
@@ -1,49 +1,69 @@-# NB: don't set `language: haskell` here+language: c+sudo: false -# The following enables several GHC versions to be tested; often it's enough to test only against the last release in a major GHC version. Feel free to omit lines listings versions you don't need/want testing for.-env:-# - CABALVER=1.16 GHCVER=6.12.3-# - CABALVER=1.16 GHCVER=7.0.1-# - CABALVER=1.16 GHCVER=7.0.2-# - CABALVER=1.16 GHCVER=7.0.3-# - CABALVER=1.16 GHCVER=7.0.4-# - CABALVER=1.16 GHCVER=7.2.1-# - CABALVER=1.16 GHCVER=7.2.2-# - CABALVER=1.16 GHCVER=7.4.1- - CABALVER=1.16 GHCVER=7.4.2-# - CABALVER=1.16 GHCVER=7.6.1-# - CABALVER=1.16 GHCVER=7.6.2- - CABALVER=1.18 GHCVER=7.6.3-# - CABALVER=1.18 GHCVER=7.8.1 # see note about Alex/Happy for GHC >= 7.8-# - CABALVER=1.18 GHCVER=7.8.2-# - CABALVER=1.18 GHCVER=7.8.3- - CABALVER=1.18 GHCVER=7.8.4 COVERAGE=1- - CABALVER=1.22 GHCVER=7.10.2-# - CABALVER=head GHCVER=head # see section about GHC HEAD snapshots+cache:+ directories:+ - $HOME/.cabsnap+ - $HOME/.cabal/packages -# Note: the distinction between `before_install` and `install` is not important.+before_cache:+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar++matrix:+ include:+ - env: CABALVER=1.16 GHCVER=7.6.3+ compiler: ": #GHC 7.6.3"+ addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}+ - env: CABALVER=1.18 GHCVER=7.8.3 COVERAGE=1+ compiler: ": #GHC 7.8.3"+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.3,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}+ - env: CABALVER=1.22 GHCVER=7.10.3+ compiler: ": #GHC 7.10.3"+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,alex-3.1.4,happy-1.19.5], sources: [hvr-ghc]}}+ before_install:- - travis_retry sudo add-apt-repository -y ppa:hvr/ghc- - travis_retry sudo apt-get update- - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER # see note about happy/alex- - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:~/.cabal/bin:$PATH:$PATH- - |- if [ $GHCVER = "head" ] || [ ${GHCVER%.*} = "7.8" ] || [ ${GHCVER%.*} = "7.10" ]; then- travis_retry sudo apt-get install happy-1.19.4 alex-3.1.3- export PATH=/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:$PATH- else- travis_retry sudo apt-get install happy alex- fi+ - unset CC+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:/opt/alex/3.1.4/bin:/opt/happy/1.19.5/bin:~/.cabal/bin:$PATH install: - cabal --version - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"- - travis_retry cabal update- - "[ -n \"$COVERAGE\" ] && cabal install hpc-coveralls || true"- - cabal install hlint- - cabal install --only-dependencies --enable-tests --enable-benchmarks+ - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];+ then+ zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >+ $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;+ fi+ - travis_retry cabal update -v+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config+ - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt+ - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt -# 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.+# check whether current requested install-plan matches cached package-db snapshot+ - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;+ then+ echo "cabal build-cache HIT";+ rm -rfv .ghc;+ cp -a $HOME/.cabsnap/ghc $HOME/.ghc;+ cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;+ else+ echo "cabal build-cache MISS";+ rm -rf $HOME/.cabsnap;+ mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;+ cabal install --only-dependencies --enable-tests --enable-benchmarks;+ fi++# snapshot package-db on cache miss+ - if [ ! -d $HOME/.cabsnap ];+ then+ echo "snapshotting package-db to build-cache";+ mkdir $HOME/.cabsnap;+ cp -a $HOME/.ghc $HOME/.cabsnap/ghc;+ cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;+ fi++# 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: - if [ -f configure.ac ]; then autoreconf -i; fi - cabal configure --enable-tests --enable-benchmarks -v2 $([ "$COVERAGE" = "1" ] && echo "--enable-library-coverage") # -v2 provides useful information for debugging@@ -51,20 +71,14 @@ - cabal test - cabal check - cabal sdist # tests that a source-distribution can be generated- - hlint --cpp-file=dist/build/autogen/cabal_macros.h src -# The following scriptlet checks that the resulting source distribution can be built & installed- - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;- cd dist/;- if [ -f "$SRC_TGZ" ]; then- cabal install --force-reinstalls "$SRC_TGZ";- else- echo "expected '$SRC_TGZ' not found";- exit 1;- fi ;- cd ..+# Check that the resulting source distribution can be built & installed.+# If there are no other `.tar.gz` files in `dist`, this can be even simpler:+# `cabal install --force-reinstalls dist/*-*.tar.gz`+ - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&+ (cd dist && cabal install --force-reinstalls "$SRC_TGZ") -after_script:- - travis_retry sudo apt-get install tree- - tree dist/ # temporarily needed to investigate issue with hpc-coveralls+# This block must be executed before before_cache+#after_script:+ - "[ -n \"$COVERAGE\" ] && cabal install hpc-coveralls --avoid-reinstalls --constraint=\"regex-posix >=0.95.2\" || true" # regex-posix-0.95.1 has compilation problem - "[ -n \"$COVERAGE\" ] && hpc-coveralls TestSign --exclude-dir=test || true"
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.4.2+-----+* fix compilation error with lattices-1.4+ 0.4.0 ----- * remove dependency on `algebra` package, since it is outdated and not compatible with recent version of other packages
README.md view
@@ -1,6 +1,6 @@ sign ==== -[](http://travis-ci.org/msakai/sign) [](https://hackage.haskell.org/package/sign) [](https://coveralls.io/r/msakai/sign)+[](http://travis-ci.org/msakai/sign) [](https://ci.appveyor.com/project/msakai/sign/branch/master) [](https://hackage.haskell.org/package/sign) [](https://coveralls.io/r/msakai/sign) Arithmetic over signs (i.e. {-,0,+}) and sets of signs
+ appveyor.yml view
@@ -0,0 +1,21 @@+install:+- ps: |+ choco install haskellplatform -version 2014.2.0.0 -y+ # Haskell Platfrom package doesn't update PATH for the current shell instance+ $env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\bin"+ $env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\lib\extralibs\bin"+ $env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\mingw\bin"+ cabal sandbox init+ $env:Path += ";.\.cabal-sandbox\bin"+ cabal update+- cabal install --only-dependencies --enable-tests --enable-benchmarks++build_script:+- cabal configure --enable-tests --enable-benchmarks -v2+- cabal build++test_script:+- cabal test+- cabal check+- cabal sdist+
sign.cabal view
@@ -1,5 +1,5 @@ Name: sign-Version: 0.4.2+Version: 0.4.3 License: BSD3 License-File: LICENSE Author: Masahiro Sakai (masahiro.sakai@gmail.com)@@ -14,12 +14,13 @@ README.md LICENSE CHANGELOG.markdown+ appveyor.yml .travis.yml Build-Type: Simple Tested-With:- GHC ==7.4.2 GHC ==7.6.3 GHC ==7.8.3+ GHC ==7.10.3 source-repository head type: git
test/TestSign.hs view
@@ -207,8 +207,11 @@ GT -> fromRational a == Set.singleton Pos prop_SetSign_recip_involution =- forAll arbitrary $ \(a :: Set Sign) ->+ forAll g $ \(a :: Set Sign) -> Zero `Set.notMember` a ==> recip (recip a) == a+ where+ g = elements $ map Set.unions $+ sequence [[Set.singleton s, Set.empty] | s <- [Neg, Zero, Pos]] prop_SetSign_Lattice_top = forAll arbitrary $ \(a :: Set Sign) ->@@ -246,6 +249,8 @@ instance CoArbitrary Sign where coarbitrary = coarbitraryEnum +#if !MIN_VERSION_QuickCheck(2,8,2)+ instance Arbitrary (Set Sign) where arbitrary = elements $ map Set.unions $ sequence [[Set.singleton s, Set.empty] | s <- [Neg, Zero, Pos]]@@ -253,6 +258,8 @@ instance CoArbitrary (Set Sign) where coarbitrary ss g = foldr (\s g -> variant (fromEnum s) g) g (Set.toList ss)++#endif ------------------------------------------------------------------------ -- Test harness