@@ -4,17 +4,14 @@ module Stackage.Test
44 ) where
55
66import qualified Control.Concurrent as C
7−import Control.Exception (Exception, handle, throwIO, finally, SomeException)
8−import Control.Monad (foldM, unless, when, replicateM)
7+import Control.Exception (Exception, handle, throwIO, SomeException)
8+import Control.Monad (unless, when, replicateM)
99import qualified Data.Map as Map
1010import qualified Data.Set as Set
1111import Data.Typeable (Typeable)
12−import Stackage.Config
1312import Stackage.Types
1413import Stackage.Util
15−import System.Directory (canonicalizePath, createDirectory,
16− removeFile)
17−import System.Environment (getEnvironment)
14+import System.Directory (createDirectory, removeFile)
1815import System.Exit (ExitCode (ExitSuccess))
1916import System.FilePath ((<.>), (</>))
2017import System.IO (IOMode (WriteMode, AppendMode),
@@ -39,12 +36,12 @@ parFoldM :: Int -- ^ number of threads
3936 -> a
4037 -> [b]
4138 -> IO a
42−parFoldM threadCount f g a0 bs0 = do
39+parFoldM threadCount0 f g a0 bs0 = do
4340 ma <- C.newMVar a0
4441 mbs <- C.newMVar bs0
4542 signal <- C.newEmptyMVar
46− tids <- replicateM threadCount $ C.forkIO $ worker ma mbs signal
47− wait threadCount signal tids
43+ tids <- replicateM threadCount0 $ C.forkIO $ worker ma mbs signal
44+ wait threadCount0 signal tids
4845 C.takeMVar ma
4946 where
5047 worker ma mbs signal =
@@ -90,8 +87,8 @@ runTestSuite settings testdir hasTestSuites (packageName, (version, Maintainer m
9087 $ ("HASKELL_PACKAGE_SANDBOX", packageDir settings)
9188 : env'
9289
93− let runGen addGPP cmd args wdir handle = do
94− ph <- runProcess cmd args (Just wdir) (menv addGPP) Nothing (Just handle) (Just handle)
90+ let runGen addGPP cmd args wdir handle' = do
91+ ph <- runProcess cmd args (Just wdir) (menv addGPP) Nothing (Just handle') (Just handle')
9592 ec <- waitForProcess ph
9693 unless (ec == ExitSuccess) $ throwIO TestException
9794