Skip to content

Commit

Permalink
Merge pull request #24 from RyanGlScott/master
Browse files Browse the repository at this point in the history
Fix tests when building with stack
  • Loading branch information
glguy committed Jul 22, 2016
2 parents f4a798b + 7ede6dc commit 7daa8df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -4,9 +4,9 @@ sudo: false
matrix:
include:
- env: CABALVER=1.22 GHCVER=7.10.3 GHCOPTS="" JOPTS="-j2"
addons: {apt: {packages: [cabal-install-1.22, ghc-7.10.3],sources: [hvr-ghc]}}
addons: {apt: {packages: [cabal-install-1.22, ghc-7.10.3, minisat],sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=8.0.1 GHCOPTS="" JOPTS="-j2"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1, minisat], sources: [hvr-ghc]}}

allow_failures:
- env: CABALVER=head GHCVER=head GHCOPTS="" JOPTS="-j2"
Expand Down
4 changes: 4 additions & 0 deletions Setup.lhs
Expand Up @@ -41,6 +41,10 @@ generateBuildModule verbosity pkg lbi = do
withTestLBI pkg lbi $ \suite suitecfg -> do
rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines
[ "module Build_" ++ testName suite ++ " where"
, ""
, "autogen_dir :: String"
, "autogen_dir = " ++ show dir
, ""
, "deps :: [String]"
, "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg))
]
Expand Down
7 changes: 3 additions & 4 deletions tests/doctests.hsc
Expand Up @@ -15,7 +15,7 @@
-----------------------------------------------------------------------------
module Main where

import Build_doctests (deps)
import Build_doctests (autogen_dir, deps)
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative
#endif
Expand Down Expand Up @@ -56,11 +56,10 @@ withUnicode m = m
main :: IO ()
main = withUnicode $ getSources >>= \sources -> doctest $
"-isrc"
: "-idist/build/autogen"
: ("-i" ++ autogen_dir)
: "-optP-include"
: "-optPdist/build/autogen/cabal_macros.h"
: ("-optP" ++ autogen_dir ++ "/cabal_macros.h")
: "-hide-all-packages"
: "-Iincludes"
: map ("-package="++) deps ++ sources

getSources :: IO [FilePath]
Expand Down

0 comments on commit 7daa8df

Please sign in to comment.