[Test] Stack: use ghc-* resolver based on ghc version

This commit is contained in:
Nikolay Yakimov 2016-08-28 23:27:39 +03:00
parent dd45f6e31d
commit 05d87f4175

View File

@ -56,7 +56,13 @@ main = do
let stackDir = "test/data/stack-project"
void $ withDirectory_ stackDir $ do
-- void $ system "stack init --force"
let ghcver = let gvn = show (__GLASGOW_HASKELL__ :: Int)
(major, minor') = splitAt (length gvn - 2) gvn
minor = case dropWhile (=='0') minor' of
"" -> "0"
x -> x
in major ++ "." ++ minor
void $ system $ "stack init --force --resolver=ghc-" ++ ghcver
void $ system "stack setup"
void $ system "stack build"