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"
16 addToPath
(takeDirectory exe_path
) $ do
17 res
<- cabal_raw_action
["help", "aaaa"] (\h
-> () <$ Process
.waitForProcess h
)
18 assertOutputContains
"I am helping with the aaaa command" res
21 cabal_raw_action
:: [String] -> (Process
.ProcessHandle
-> IO ()) -> TestM Result
22 cabal_raw_action args action
= do
23 configured_prog
<- requireProgramM cabalProgram
25 r
<- liftIO
$ runAction
(testVerbosity env
)
26 (Just
$ testCurrentDir env
)
28 (programPath configured_prog
)