Permalink
Browse files

stack support

  • Loading branch information...
larsrh committed Jul 20, 2016
1 parent d562fa9 commit 98fd450cd3404bff0606df0eb7271a14fa1d7eec
Showing with 66 additions and 26 deletions.
  1. +1 −0 .gitignore
  2. +13 −11 .travis.yml
  3. +17 −0 .travis/install
  4. +16 −0 .travis/test
  5. +4 −1 haskell_tool/fffuu.cabal
  6. +3 −0 haskell_tool/stack.yaml
  7. +12 −4 haskell_tool/test/Suites/FffuuBinary.hs
  8. +0 −10 travis-test
@@ -17,6 +17,7 @@ __pycache__/
dist
.cabal-sandbox
cabal.sandbox.config
.stack-work
# generated code
thy/Examples/generated_code
@@ -4,26 +4,28 @@ sudo: false
matrix:
include:
- env: CABALVER=1.22 GHCVER=7.8.4
compiler: ": #GHC 7.8.4"
compiler: "GHC 7.8.4"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.8.4], sources: [hvr-ghc]}}
- env: CABALVER=1.22 GHCVER=7.10.3
compiler: ": #GHC 7.10.3"
compiler: "GHC 7.10.3"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=8.0.1 BINTRAY_DEPLOY=true
compiler: ": #GHC 8.0.1"
compiler: "GHC 8.0.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
- env: STACK=1
compiler: "Stackage LTS"
addons: {apt: {packages: [libgmp,libgmp-dev]}}
cache:
directories:
- $HOME/.stack
before_install:
- unset CC
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
install:
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update -v
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$PATH
script: ./travis-test
install: ./.travis/install
script: ./.travis/test
deploy:
provider: bintray
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
set -x
if [ -n "$STACK" ]; then
echo "Using stack ..."
mkdir -p "$HOME/.local/bin"
curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C "$HOME/.local/bin" '*/stack'
(cd haskell_tool && stack setup)
else
echo "Using cabal ..."
cabal --version
echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
cabal update -v
sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
fi
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e
set -x
./check_theorems_doc.sh
cd haskell_tool
if [ -n "$STACK" ]; then
stack --no-terminal --skip-ghc-check test
else
cabal install --only-dependencies --enable-tests --enable-benchmarks
cabal configure --enable-tests --enable-benchmarks -v2
cabal build
cabal test --show-details=streaming
fi
@@ -69,9 +69,12 @@ test-suite test
main-is: Main.hs
ghc-options: -O2 -W
other-modules:
Suites.Parser
Suites.FffuuBinary
, Suites.Parser
, Suites.ParserHelper
build-depends:
base >=4.7 && <5
, directory >=1.0 && <1.3
, containers >=0.5 && <0.6
, split >= 0.2.3 && <= 0.2.4
, parsec >=3.0 && <3.2
@@ -0,0 +1,3 @@
resolver: lts-6.7
packages:
- '.'
@@ -4,6 +4,7 @@ import Data.List (intercalate)
import Test.Tasty
import Test.Tasty.Golden as Golden
import qualified Data.ByteString.Lazy.Char8 as B
import System.Directory (doesFileExist)
import System.Process (readProcess)
@@ -13,11 +14,18 @@ execFffuu :: TestName
-> FilePath -- path to the golden file (expected output)
-> TestTree
execFffuu name argv goldenFile = Golden.goldenVsStringDiff fancyName diffCmd goldenFile $ do
outp <- readProcess fffuuBin argv ""
(bin, argv') <- do
let bin = "./dist/build/fffuu/fffuu"
exists <- doesFileExist bin
return $
if exists then
(bin, argv)
else
("/usr/bin/env", ["stack", "exec", "fffuu", "--"] ++ argv)
outp <- readProcess bin argv' ""
return $ B.pack outp
where diffCmd = \ref new -> ["/usr/bin/diff", "-u", ref, new]
fffuuBin = "./dist/build/fffuu/fffuu"
fancyName = name ++ ": `" ++ fffuuBin ++ " " ++ (intercalate " " argv) ++ "`"
where diffCmd = \ref new -> ["/usr/bin/env", "diff", "-u", ref, new]
fancyName = name ++ ": `fffuu " ++ (intercalate " " argv) ++ "`"
tests = testGroup "fffuu compiled binary output" $

This file was deleted.

Oops, something went wrong.

0 comments on commit 98fd450

Please sign in to comment.