File tree Expand file tree Collapse file tree 6 files changed +38
-78
lines changed Expand file tree Collapse file tree 6 files changed +38
-78
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ extra-source-files: README.md ChangeLog.md
3030 new-template/LICENSE
3131 new-template/Setup.hs
3232
33+ flag integration-tests
34+ manual : True
35+ default : False
36+ description : Run the integration test suite
37+
3338library
3439 hs-source-dirs : src/
3540 ghc-options : -Wall
@@ -212,6 +217,34 @@ test-suite stack-test
212217 , Cabal
213218 default-language : Haskell2010
214219
220+ test-suite stack-integration-test
221+ type : exitcode-stdio-1.0
222+ hs-source-dirs : test/integration
223+ main-is : Spec.hs
224+ ghc-options : -Wall -threaded -rtsopts -with-rtsopts=-N
225+
226+ if flag(integration-tests)
227+ buildable : True
228+ else
229+ buildable : False
230+
231+ build-depends : base >= 4.7 && < 10
232+ , temporary
233+ , hspec
234+ , process
235+ , filepath
236+ , directory
237+ , text
238+ , unix-compat
239+ , containers
240+ , conduit
241+ , conduit-extra
242+ , resourcet
243+ , async
244+ , transformers
245+ , bytestring
246+ default-language : Haskell2010
247+
215248source-repository head
216249 type : git
217250 location : https://github.com/commercialhaskell/stack
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import Test.Hspec
3131
3232main :: IO ()
3333main = do
34- currDir <- getCurrentDirectory
34+ currDir <- canonicalizePath " test/integration "
3535
3636 let findExe name = do
3737 mexe <- findExecutable name
@@ -41,7 +41,8 @@ main = do
4141 runghc <- findExe " runghc"
4242 stack <- findExe " stack"
4343
44- tests <- getDirectoryContents " tests" >>= filterM hasTest
44+ let testDir = currDir </> " tests"
45+ tests <- getDirectoryContents testDir >>= filterM (hasTest testDir)
4546
4647 envOrig <- getEnvironment
4748
@@ -58,8 +59,8 @@ main = do
5859
5960 hspec $ mapM_ (test runghc env' currDir origStackRoot newHome) tests
6061
61- hasTest :: FilePath -> IO Bool
62- hasTest dir = doesFileExist $ " tests " </> dir </> " Main.hs"
62+ hasTest :: FilePath -> FilePath -> IO Bool
63+ hasTest root dir = doesFileExist $ root </> dir </> " Main.hs"
6364
6465test :: FilePath -- ^ runghc
6566 -> [(String , String )] -- ^ env
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments