env:
 - CABALVER=1.16 GHCVER=7.6.3
 - CABALVER=1.18 GHCVER=7.8.4
 - CABALVER=1.22 GHCVER=7.10.2
 - CABALVER=head GHCVER=head

matrix:
  allow_failures:
    - env: CABALVER=head GHCVER=head

before_install:
  - sudo add-apt-repository -y ppa:hvr/ghc
  - sudo add-apt-repository -y ppa:neovim-ppa/unstable
  - sudo apt-get update

  - sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
  - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH

  - sudo apt-get install neovim

install:
  - cabal update
  # Enable these if they're needed
  # - sudo apt-get install alex-3.1.4
  # - export PATH=/opt/alex/3.1.4/bin:$PATH
  # - sudo apt-get install happy-1.19.5
  # - export PATH=/opt/happy/1.19.5/bin:$PATH
  - cabal install --only-dependencies --enable-tests

script:
  - cabal configure --enable-tests
  - cabal install # Tests won't work without this
  - cabal clean
  - cabal configure --enable-tests
  - cabal test
  - cabal check
  - cabal sdist

env:
 - CABALVER=1.16 GHCVER=7.6.3
 - CABALVER=1.18 GHCVER=7.8.4
 - CABALVER=1.22 GHCVER=7.10.2
 - CABALVER=head GHCVER=head

matrix:
  allow_failures:
    - env: CABALVER=head GHCVER=head

before_install:
  - sudo add-apt-repository -y ppa:hvr/ghc
  - sudo add-apt-repository -y ppa:neovim-ppa/unstable
  - sudo apt-get update

  - sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
  - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH

  - sudo apt-get install neovim

install:
  - cabal update
  # Enable these if they're needed
  # - sudo apt-get install alex-3.1.4
  # - export PATH=/opt/alex/3.1.4/bin:$PATH
  # - sudo apt-get install happy-1.19.5
  # - export PATH=/opt/happy/1.19.5/bin:$PATH
  - cabal install --only-dependencies --enable-tests

script:
  - cabal clean
  - cabal install --enable-tests # Tests won't work without this
  - cabal clean
  - cabal configure --enable-tests
  - cabal test
  - cabal check
  - cabal sdist

Add --enable-tests to install command
Add --enable-tests to install command
