2013-02-27 19:35:07 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2015-07-13 17:19:20 +00:00
|
|
|
- Copyright 2013-2015 Joey Hess <id@joeyh.name>
|
2013-02-27 19:35:07 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Test where
|
|
|
|
|
|
|
|
import Command
|
2015-07-13 17:19:20 +00:00
|
|
|
import Types.Test
|
2013-02-27 19:35:07 +00:00
|
|
|
|
2018-11-19 16:39:16 +00:00
|
|
|
cmd :: Parser TestOptions -> TestRunner -> Command
|
2015-07-13 17:19:20 +00:00
|
|
|
cmd optparser runner = noRepo (startIO runner <$$> const optparser) $
|
|
|
|
dontCheck repoExists $
|
|
|
|
command "test" SectionTesting
|
|
|
|
"run built-in test suite"
|
|
|
|
paramNothing (seek runner <$$> const optparser)
|
2013-02-27 19:35:07 +00:00
|
|
|
|
2018-11-19 16:39:16 +00:00
|
|
|
seek :: TestRunner -> TestOptions -> CommandSeek
|
2015-07-13 17:19:20 +00:00
|
|
|
seek runner o = commandAction $ start runner o
|
2013-02-27 19:35:07 +00:00
|
|
|
|
2018-11-19 16:39:16 +00:00
|
|
|
start :: TestRunner -> TestOptions -> CommandStart
|
2015-07-13 17:19:20 +00:00
|
|
|
start runner o = do
|
|
|
|
liftIO $ startIO runner o
|
2014-01-15 16:49:56 +00:00
|
|
|
stop
|
2014-01-17 18:48:56 +00:00
|
|
|
|
2018-11-19 16:39:16 +00:00
|
|
|
startIO :: TestRunner -> TestOptions -> IO ()
|
|
|
|
startIO runner o = runner o
|