1 import Test
.Cabal
.Prelude
2 import qualified System
.Process
as Process
3 import Control
.Concurrent
(threadDelay
)
4 import System
.Directory
(removeFile)
5 import Control
.Exception
(catch, throwIO
)
6 import System
.IO.Error
(isDoesNotExistError)
7 import qualified Data
.Time
.Clock
as Time
8 import qualified Data
.Time
.Format
as Time
10 import System
.Environment
14 res
<- cabalWithStdin
"v2-build" ["all"] ""
15 exe_path
<- withPlan
$ planExePath
"setup-test" "cabal-aaaa"
17 let new_env
= (("OTHER_VAR", Just
"is set") : (testEnvironment env
))
18 withEnv new_env
$ addToPath
(takeDirectory exe_path
) $ do
19 res
<- cabal_raw_action
["aaaa"] (\h
-> () <$ Process
.waitForProcess h
)
20 assertOutputContains
"cabal-install" res
21 assertOutputContains
"is set" res
24 cabal_raw_action
:: [String] -> (Process
.ProcessHandle
-> IO ()) -> TestM Result
25 cabal_raw_action args action
= do
26 configured_prog
<- requireProgramM cabalProgram
28 r
<- liftIO
$ runAction
(testVerbosity env
)
29 (Just
(testCurrentDir env
))
31 (programPath configured_prog
)