File tree Expand file tree Collapse file tree 8 files changed +42
-2
lines changed Expand file tree Collapse file tree 8 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ before_install:
2222 - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
2323 - travis_retry sudo apt-get update
2424 - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER # see note about happy/alex
25- - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
25+ - export PATH=$HOME/.cabal/bin: /opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
2626
2727install :
2828 - cabal --version
@@ -39,6 +39,9 @@ script:
3939 - cabal check
4040 - cabal sdist # tests that a source-distribution can be generated
4141
42+ - cd test/integration
43+ - stack test
44+
4245# Check that the resulting source distribution can be built & installed.
4346# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
4447# `cabal install --force-reinstalls dist/*-*.tar.gz`
Original file line number Diff line number Diff line change 1+ main :: IO ()
2+ main = return ()
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ test :: FilePath -- ^ runghc
6868 -> String
6969 -> Spec
7070test runghc env' currDir origStackRoot newHome name = it name $ withDir $ \ dir -> do
71+ removeDirectoryRecursive newHome
7172 copyStackRoot origStackRoot (newHome </> takeFileName origStackRoot)
7273 let testDir = currDir </> " tests" </> name
7374 mainFile = testDir </> " Main.hs"
Original file line number Diff line number Diff line change @@ -29,3 +29,15 @@ stackErr args = do
2929 if ec == ExitSuccess
3030 then error " stack was supposed to fail, but didn't"
3131 else return ()
32+
33+ doesNotExist :: FilePath -> IO ()
34+ doesNotExist fp = do
35+ putStrLn $ " doesNotExist " ++ fp
36+ isFile <- doesFileExist fp
37+ if isFile
38+ then error $ " File exists: " ++ fp
39+ else do
40+ isDir <- doesDirectoryExist fp
41+ if isDir
42+ then error $ " Directory exists: " ++ fp
43+ else return ()
Original file line number Diff line number Diff line change @@ -11,7 +11,15 @@ build-type: Simple
1111cabal-version : >= 1.10
1212homepage : https://github.com/commercialhaskell/stack
1313
14- executable stack-integration-tests
14+ -- This is only present because cabal won't allow a test suite without a
15+ -- library or executable
16+ executable stack-integration-dummy
17+ main-is : Dummy.hs
18+ build-depends : base
19+ default-language : Haskell2010
20+
21+ test-suite stack-integration-tests
22+ type : exitcode-stdio-1.0
1523 main-is : Spec.hs
1624
1725 build-depends : base >= 4.7 && < 10
Original file line number Diff line number Diff line change 1+ import StackTest
2+
3+ main :: IO ()
4+ main = do
5+ stack [" install" , " acme-missiles-0.3" ]
6+ doesNotExist " stack.yaml"
Original file line number Diff line number Diff line change 1+ import StackTest
2+
3+ main :: IO ()
4+ main = do
5+ stack [" unpack" , " text-1.2.1.1" ]
6+ stack [" init" , " --resolver" , " lts-2.9" ]
7+ stack [" test" , " --dry-run" ]
Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ main = do
99 stackErr [" command-does-not-exist" ]
1010 stackErr [" unpack" , " invalid-package-name-" ]
1111 stackErr [" build" ]
12+ doesNotExist " stack.yaml"
You can’t perform that action at this time.
0 commit comments