remove leftovers from removed TestSuite build flag
Test suite is always built, so this can be simplified.
This commit is contained in:
parent
1f9f220816
commit
83109affd1
4 changed files with 15 additions and 19 deletions
|
@ -123,7 +123,7 @@ import qualified Command.TestRemote
|
||||||
import qualified Command.Benchmark
|
import qualified Command.Benchmark
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cmds :: Parser TestOptions -> Maybe TestRunner -> [Command]
|
cmds :: Parser TestOptions -> TestRunner -> [Command]
|
||||||
cmds testoptparser testrunner =
|
cmds testoptparser testrunner =
|
||||||
[ Command.Help.cmd
|
[ Command.Help.cmd
|
||||||
, Command.Add.cmd
|
, Command.Add.cmd
|
||||||
|
@ -233,7 +233,7 @@ cmds testoptparser testrunner =
|
||||||
#endif
|
#endif
|
||||||
]
|
]
|
||||||
|
|
||||||
run :: Parser TestOptions -> Maybe TestRunner -> [String] -> IO ()
|
run :: Parser TestOptions -> TestRunner -> [String] -> IO ()
|
||||||
run testoptparser testrunner args = go envmodes
|
run testoptparser testrunner args = go envmodes
|
||||||
where
|
where
|
||||||
go [] = dispatch True args
|
go [] = dispatch True args
|
||||||
|
|
|
@ -10,21 +10,20 @@ module Command.Test where
|
||||||
import Command
|
import Command
|
||||||
import Types.Test
|
import Types.Test
|
||||||
|
|
||||||
cmd :: Parser TestOptions -> Maybe TestRunner -> Command
|
cmd :: Parser TestOptions -> TestRunner -> Command
|
||||||
cmd optparser runner = noRepo (startIO runner <$$> const optparser) $
|
cmd optparser runner = noRepo (startIO runner <$$> const optparser) $
|
||||||
dontCheck repoExists $
|
dontCheck repoExists $
|
||||||
command "test" SectionTesting
|
command "test" SectionTesting
|
||||||
"run built-in test suite"
|
"run built-in test suite"
|
||||||
paramNothing (seek runner <$$> const optparser)
|
paramNothing (seek runner <$$> const optparser)
|
||||||
|
|
||||||
seek :: Maybe TestRunner -> TestOptions -> CommandSeek
|
seek :: TestRunner -> TestOptions -> CommandSeek
|
||||||
seek runner o = commandAction $ start runner o
|
seek runner o = commandAction $ start runner o
|
||||||
|
|
||||||
start :: Maybe TestRunner -> TestOptions -> CommandStart
|
start :: TestRunner -> TestOptions -> CommandStart
|
||||||
start runner o = do
|
start runner o = do
|
||||||
liftIO $ startIO runner o
|
liftIO $ startIO runner o
|
||||||
stop
|
stop
|
||||||
|
|
||||||
startIO :: Maybe TestRunner -> TestOptions -> IO ()
|
startIO :: TestRunner -> TestOptions -> IO ()
|
||||||
startIO Nothing _ = warningIO "git-annex was built without its test suite; not testing"
|
startIO runner o = runner o
|
||||||
startIO (Just runner) o = runner o
|
|
||||||
|
|
17
Test.hs
17
Test.hs
|
@ -103,28 +103,25 @@ optParser = TestOptions
|
||||||
)
|
)
|
||||||
<*> cmdParams "non-options are for internal use only"
|
<*> cmdParams "non-options are for internal use only"
|
||||||
|
|
||||||
runner :: Maybe (TestOptions -> IO ())
|
runner :: TestOptions -> IO ()
|
||||||
runner = Just go
|
runner opts
|
||||||
|
| fakeSsh opts = runFakeSsh (internalData opts)
|
||||||
|
| otherwise = runsubprocesstests =<< Utility.Env.getEnv subenv
|
||||||
where
|
where
|
||||||
go opts
|
|
||||||
| fakeSsh opts = runFakeSsh (internalData opts)
|
|
||||||
| otherwise = runsubprocesstests opts
|
|
||||||
=<< Utility.Env.getEnv subenv
|
|
||||||
|
|
||||||
-- Run git-annex test in a subprocess, so that any files
|
-- Run git-annex test in a subprocess, so that any files
|
||||||
-- it may open will be closed before running finalCleanup.
|
-- it may open will be closed before running finalCleanup.
|
||||||
-- This should prevent most failures to clean up after the test
|
-- This should prevent most failures to clean up after the test
|
||||||
-- suite.
|
-- suite.
|
||||||
subenv = "GIT_ANNEX_TEST_SUBPROCESS"
|
subenv = "GIT_ANNEX_TEST_SUBPROCESS"
|
||||||
runsubprocesstests opts Nothing = do
|
runsubprocesstests Nothing = do
|
||||||
pp <- Annex.Path.programPath
|
pp <- Annex.Path.programPath
|
||||||
Utility.Env.Set.setEnv subenv "1" True
|
Utility.Env.Set.setEnv subenv "1" True
|
||||||
ps <- getArgs
|
ps <- getArgs
|
||||||
(Nothing, Nothing, Nothing, pid) <-createProcess (proc pp ps)
|
(Nothing, Nothing, Nothing, pid) <- createProcess (proc pp ps)
|
||||||
exitcode <- waitForProcess pid
|
exitcode <- waitForProcess pid
|
||||||
unless (keepFailuresOption opts) finalCleanup
|
unless (keepFailuresOption opts) finalCleanup
|
||||||
exitWith exitcode
|
exitWith exitcode
|
||||||
runsubprocesstests opts (Just _) = isolateGitConfig $ do
|
runsubprocesstests (Just _) = isolateGitConfig $ do
|
||||||
ensuretmpdir
|
ensuretmpdir
|
||||||
crippledfilesystem <- fst <$> Annex.Init.probeCrippledFileSystem' tmpdir
|
crippledfilesystem <- fst <$> Annex.Init.probeCrippledFileSystem' tmpdir
|
||||||
case tryIngredients ingredients (tastyOptionSet opts) (tests crippledfilesystem opts) of
|
case tryIngredients ingredients (tastyOptionSet opts) (tests crippledfilesystem opts) of
|
||||||
|
|
|
@ -65,7 +65,7 @@ git_annex' command params = do
|
||||||
-- catch all errors, including normally fatal errors
|
-- catch all errors, including normally fatal errors
|
||||||
try run ::IO (Either SomeException ())
|
try run ::IO (Either SomeException ())
|
||||||
where
|
where
|
||||||
run = GitAnnex.run dummyTestOptParser Nothing (command:"-q":params)
|
run = GitAnnex.run dummyTestOptParser (\_ -> noop) (command:"-q":params)
|
||||||
dummyTestOptParser = pure mempty
|
dummyTestOptParser = pure mempty
|
||||||
|
|
||||||
{- Runs git-annex and returns its output. -}
|
{- Runs git-annex and returns its output. -}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue