diff --git a/test/integration/lib/StackTest.hs b/test/integration/lib/StackTest.hs index c71c4a3c09..ed5bf0a4a2 100644 --- a/test/integration/lib/StackTest.hs +++ b/test/integration/lib/StackTest.hs @@ -121,3 +121,9 @@ exeExt = if isWindows then ".exe" else "" -- | Is the OS Windows? isWindows = os == "mingw32" + +-- | To avoid problems with GHC version mismatch when a new LTS major +-- version is released, pass this argument to @stack@ when running in +-- a global context. The LTS major version here should match that of +-- the main @stack.yaml@. +defaultResolverArg = "--resolver=lts-3" diff --git a/test/integration/tests/1198-multiple-exes-with-same-name/Main.hs b/test/integration/tests/1198-multiple-exes-with-same-name/Main.hs index 57f070fa90..4e8344263d 100644 --- a/test/integration/tests/1198-multiple-exes-with-same-name/Main.hs +++ b/test/integration/tests/1198-multiple-exes-with-same-name/Main.hs @@ -4,8 +4,8 @@ import StackTest main :: IO () main = do - stack ["clean"] - stack ["init", "--force"] + stack [defaultResolverArg, "clean"] + stack [defaultResolverArg, "init", "--force"] stackCheckStderr ["build", "also-has-exe-foo", "has-exe-foo"] (expectMessage buildMessage1) diff --git a/test/integration/tests/384-local-deps/Main.hs b/test/integration/tests/384-local-deps/Main.hs index 17430dc562..776ac31386 100644 --- a/test/integration/tests/384-local-deps/Main.hs +++ b/test/integration/tests/384-local-deps/Main.hs @@ -2,5 +2,5 @@ import StackTest main :: IO () main = do - stack ["init"] + stack ["init", defaultResolverArg] stack ["test"] diff --git a/test/integration/tests/443-specify-path/Main.hs b/test/integration/tests/443-specify-path/Main.hs index 4f939ac869..47fef94c08 100644 --- a/test/integration/tests/443-specify-path/Main.hs +++ b/test/integration/tests/443-specify-path/Main.hs @@ -7,7 +7,7 @@ main :: IO () main = do -- install in relative path createDirectory "bin" - stack ["--local-bin-path", "./bin", "install" , "happy"] + stack [defaultResolverArg, "--local-bin-path", "./bin", "install" , "happy"] doesExist ("./bin/happy" ++ exeExt) -- Default install @@ -18,11 +18,11 @@ main = do -- doesExist (defaultDir ++ "/bin/happy" ++ exeExt) -- install in current dir - stack ["--local-bin-path", ".", "install", "happy" ] + stack [defaultResolverArg, "--local-bin-path", ".", "install", "happy" ] doesExist ("happy" ++ exeExt) -- install in absolute path tmpDirectory <- fmap ( "absolute-bin") getCurrentDirectory createDirectory tmpDirectory - stack ["--local-bin-path", tmpDirectory, "install", "happy" ] + stack [defaultResolverArg, "--local-bin-path", tmpDirectory, "install", "happy" ] doesExist (tmpDirectory ("happy" ++ exeExt)) diff --git a/test/integration/tests/basic-install/Main.hs b/test/integration/tests/basic-install/Main.hs index a638f19f4a..c49f21b659 100644 --- a/test/integration/tests/basic-install/Main.hs +++ b/test/integration/tests/basic-install/Main.hs @@ -2,5 +2,5 @@ import StackTest main :: IO () main = do - stack ["install", "acme-missiles-0.3"] + stack [defaultResolverArg, "install", "acme-missiles-0.3"] doesNotExist "stack.yaml" diff --git a/test/integration/tests/multi-test/Main.hs b/test/integration/tests/multi-test/Main.hs index a8172ea5f4..dcec42e2b4 100644 --- a/test/integration/tests/multi-test/Main.hs +++ b/test/integration/tests/multi-test/Main.hs @@ -6,8 +6,9 @@ main :: IO () main = do stack ["build"] stack ["test"] - -- FIXME: Make fforce-recomp unnecessary (see #1411) - stackCheckStderr ["test", "--coverage", "--ghc-options", "-fforce-recomp"] $ \out -> do + -- FIXME: Make 'clean' unnecessary (see #1411) + stack ["clean"] + stackCheckStderr ["test", "--coverage"] $ \out -> do unless ("The coverage report for multi-test-suite's test-suite \"multi-test-suite-test\" is available at" `isInfixOf` out) $ fail "Didn't get expected report for multi-test-suite-test" unless ("Error: The coverage report for multi-test-suite's test-suite \"multi-test-suite-test-2\" did not consider any code." `isInfixOf` out) $ diff --git a/test/integration/tests/sanity/Main.hs b/test/integration/tests/sanity/Main.hs index 8361951a9c..43cc81d6bb 100644 --- a/test/integration/tests/sanity/Main.hs +++ b/test/integration/tests/sanity/Main.hs @@ -11,4 +11,4 @@ main = do stackErr ["build"] doesNotExist "stack.yaml" - stack ["exec", "./foo.bat"] + stack [defaultResolverArg, "exec", "./foo.bat"]