aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/GhcSession.hs17
-rw-r--r--tests/stack-resolvers14
2 files changed, 19 insertions, 12 deletions
diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs
index 91e30aa..b555f47 100644
--- a/tests/GhcSession.hs
+++ b/tests/GhcSession.hs
@@ -17,7 +17,6 @@ import qualified Control.Exception as E
import Control.Monad
import Control.Monad.IO.Class
import Data.List
-import Data.Tuple
import Data.Version
import Data.Bifunctor
import qualified Data.Map as Map
@@ -26,6 +25,7 @@ import System.Exit
import System.FilePath ((</>), (<.>), makeRelative, takeDirectory)
import System.Directory
import System.IO
+import System.IO.Unsafe (unsafePerformIO)
import System.IO.Temp
import Text.Printf (printf)
-- import Text.Show.Pretty (pPrint)
@@ -409,17 +409,10 @@ lookupStackResolver ghcVer = maybe (Left msg) Right $
msg = SkipReason $ "missing stack_resolver_table entry for "++
showVersion ghcVer
-stack_resolver_table :: [(Version, String)]
-stack_resolver_table = map (swap . second parseVer)
- [ ("lts-13.5", "8.6.3")
- , ("lts-12.26", "8.4.4")
- , ("lts-12.14", "8.4.3")
- , ("lts-11.22", "8.2.2")
- , ("lts-9.21", "8.0.2")
- , ("lts-7.24", "8.0.1")
- , ("lts-6.35", "7.10.3")
- , ("lts-3.22", "7.10.2")
- ]
+stack_resolver_table :: [(Version, String)] -- ^ (ghc version, stack resolver)
+stack_resolver_table = unsafePerformIO $
+ map (\(words -> [g, l]) -> (parseVer g, l)) . lines
+ <$> readFile "tests/stack-resolvers"
copyStackYamls :: FilePath -> FilePath -> IO ()
copyStackYamls srcdir destdir = do
diff --git a/tests/stack-resolvers b/tests/stack-resolvers
new file mode 100644
index 0000000..7d70a27
--- /dev/null
+++ b/tests/stack-resolvers
@@ -0,0 +1,14 @@
+8.6.5 lts-13.23
+8.4.4 lts-12.26
+8.2.2 lts-11.22
+8.2.2 lts-10.10
+8.0.2 lts-9.21
+8.0.2 lts-8.24
+8.0.1 lts-7.24
+7.10.3 lts-6.35
+7.10.3 lts-5.18
+7.10.3 lts-4.2
+7.10.2 lts-3.22
+7.8.4 lts-2.22
+7.8.4 lts-1.15
+7.8.3 lts-0.7