2013-02-27 15:35:07 -04:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2015-07-13 13:19:20 -04:00
|
|
|
- Copyright 2013-2015 Joey Hess <id@joeyh.name>
|
2013-02-27 15:35:07 -04:00
|
|
|
-
|
2019-03-13 15:48:14 -04:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2013-02-27 15:35:07 -04:00
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Test where
|
|
|
|
|
|
|
|
import Command
|
2015-07-13 13:19:20 -04:00
|
|
|
import Types.Test
|
2013-02-27 15:35:07 -04:00
|
|
|
|
2018-11-19 12:39:16 -04:00
|
|
|
cmd :: Parser TestOptions -> TestRunner -> Command
|
2015-07-13 13:19:20 -04: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 15:35:07 -04:00
|
|
|
|
2018-11-19 12:39:16 -04:00
|
|
|
seek :: TestRunner -> TestOptions -> CommandSeek
|
2015-07-13 13:19:20 -04:00
|
|
|
seek runner o = commandAction $ start runner o
|
2013-02-27 15:35:07 -04:00
|
|
|
|
2018-11-19 12:39:16 -04:00
|
|
|
start :: TestRunner -> TestOptions -> CommandStart
|
2015-07-13 13:19:20 -04:00
|
|
|
start runner o = do
|
|
|
|
liftIO $ startIO runner o
|
2014-01-15 12:49:56 -04:00
|
|
|
stop
|
2014-01-17 14:48:56 -04:00
|
|
|
|
2018-11-19 12:39:16 -04:00
|
|
|
startIO :: TestRunner -> TestOptions -> IO ()
|
|
|
|
startIO runner o = runner o
|