Skip to content

Commit

Permalink
Merge pull request #4696 from commercialhaskell/integration-test-impr…
Browse files Browse the repository at this point in the history
…ovements

A number of integration test improvements
  • Loading branch information
snoyberg authored Apr 4, 2019
2 parents ba8c5e5 + 3b8491b commit 30f685a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 17 deletions.
4 changes: 1 addition & 3 deletions test/integration/tests/2433-ghc-by-version/files/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

set -exuo pipefail

export PATH=$(pwd)/fake-path:$($STACK_EXE path --resolver ghc-8.2.2 --compiler-bin):$($STACK_EXE path --resolver ghc-8.4.4 --compiler-bin):$PATH
export PATH=$(pwd)/fake-path:$($STACK_EXE path --resolver ghc-8.2.2 --compiler-bin):$PATH
export STACK_ROOT=$(pwd)/fake-root

which ghc

$STACK_EXE --system-ghc --no-install-ghc --resolver ghc-8.2.2 ghc -- --info
$STACK_EXE --system-ghc --no-install-ghc --resolver ghc-8.4.4 ghc -- --info

$STACK_EXE --system-ghc --no-install-ghc --resolver ghc-8.2.2 runghc foo.hs
3 changes: 1 addition & 2 deletions test/integration/tests/2465-init-no-packages/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Control.Monad (unless)
main :: IO ()
main = do
removeFileIgnore "stack.yaml"
stack ["init"]
stack ["init", "--resolver", "ghc-8.2.2"]
exists <- doesFileExist "stack.yaml"
unless exists $ error "stack.yaml not created!"
stack ["build"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import StackTest

main :: IO ()
main = do
removeDirIgnore "primitive-0.6.2.0"
removeFileIgnore "primitive-0.6.2.0.tar.gz"
stack ["unpack", "primitive-0.6.2.0@rev:0"]
run "tar" ["cf", "primitive-0.6.2.0.tar.gz", "primitive-0.6.2.0"]
stack ["clean", "--stack-yaml", "stack-good.yaml", "--full"]
stackErr ["build", "--stack-yaml", "stack-bad.yaml"]
stack ["build", "--stack-yaml", "stack-good.yaml"]
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
foo.cabal
/primitive-0.6.2.0/
/primitive-0.6.2.0.tar.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ version: 0

dependencies:
- base
- primitive
- bad-bounds

library: {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
resolver: ghc-8.2.2
packages:
- ./primitive-0.6.2.0.tar.gz
- ./bad-bounds.tar

# Include a flag to get a different snapshot hash
flags:
bad-bounds:
unimportant: false
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
resolver: ghc-8.2.2
extra-deps:
- ./primitive-0.6.2.0.tar.gz
# Include an extra package to get a different snapshot hash
- acme-missiles-0.3
- ./bad-bounds.tar

# Include a flag to get a different snapshot hash
flags:
bad-bounds:
unimportant: true
2 changes: 1 addition & 1 deletion test/integration/tests/mutable-deps/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Data.List (isInfixOf)
import StackTest

main :: IO ()
main = do
main = unless isWindows $ do -- depedency issues on Windows
let expectRecompilation pkgs stderr = forM_ pkgs $ \p ->
unless ((p ++ ": build") `isInfixOf` stderr) $
error $ "package " ++ show p ++ " recompilation was expected"
Expand Down

0 comments on commit 30f685a

Please sign in to comment.