Skip to content

Commit

Permalink
improve 2643 integration test, better checks of correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
kadoban committed Aug 14, 2017
1 parent c3de3e6 commit 89ea8cb
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions test/integration/tests/2643-copy-compiler-tool/Main.hs
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
import StackTest
import System.Directory

main :: IO ()
main = do
-- init
stack ["init", defaultResolverArg]

-- place to throw some exes
createDirectory "binny"

-- check assumptions on exec and the build flags and clean
stack ["build", "--flag", "*:build-baz"]
stack ["exec", "--", "baz-exe" ++ exeExt]
stackErr ["exec", "--", "bar-exe" ++ exeExt]
stack ["clean", "--full"]
stackErr ["exec", "--", "baz-exe" ++ exeExt]

-- install one exe normally and two compiler-tools, opposite ways
-- install one exe normally
stack ["install",
"--local-bin-path", "./binny",
"--flag", "*:build-foo"
]

-- and install two compiler-tools, opposite ways
-- (build or install)
stack ["install", "--flag", "*:build-foo"]
stack ["build", "--copy-compiler-tool", "--flag", "*:build-bar"]
stack ["install", "--copy-compiler-tool", "--flag", "*:build-baz"]
stack ["build",
"--local-bin-path", "./binny",
"--copy-compiler-tool",
"--flag", "*:build-bar"
]
stack ["install",
"--local-bin-path", "./binny",
"--copy-compiler-tool",
"--flag", "*:build-baz"
]

-- nuke the built things that go in .stack-work/, so we can test if
-- the installed ones exist for sure
Expand All @@ -26,8 +43,14 @@ main = do
stack ["exec", "--", "bar-exe" ++ exeExt]
stack ["exec", "--", "baz-exe" ++ exeExt]

-- foo was installed as a normal exe (in .local/bin/), so shouldn't
-- TODO: Check this in a more reliable fashion
-- foo was installed as a normal exe (in .binny/, which can't be on PATH),
-- so shouldn't
stackErr ["exec", "--", "foo-exe" ++ exeExt]

-- TODO: check paths against `stack path`
-- check existences make sense
doesExist $ "./binny/foo-exe" ++ exeExt
doesNotExist $ "./binny/bar-exe" ++ exeExt
doesNotExist $ "./binny/baz-exe" ++ exeExt

-- just check that this exists
stack ["path", "--compiler-tools-bin"]

0 comments on commit 89ea8cb

Please sign in to comment.