testremote in test is working

Not yet testing export, or remote variants, but it already adds several
hundred test cases, so big win.
This commit is contained in:
Joey Hess 2020-04-30 12:59:20 -04:00
parent d7db481471
commit 735d2e90df
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 48 additions and 39 deletions

View file

@ -417,17 +417,19 @@ testMode opts v = TestMode
hasUnlockedFiles :: TestMode -> Bool
hasUnlockedFiles m = unlockedFiles m || adjustedUnlockedBranch m
withTestMode :: TestMode -> TestTree -> TestTree -> TestTree
withTestMode testmode inittests = withResource prepare release . const
withTestMode :: TestMode -> Maybe TestTree -> TestTree -> TestTree
withTestMode testmode minittests = withResource prepare release . const
where
prepare = do
setTestMode testmode
setmainrepodir =<< newmainrepodir
case tryIngredients [consoleTestReporter] mempty inittests of
Nothing -> error "No tests found!?"
Just act -> unlessM act $
error "init tests failed! cannot continue"
return ()
case minittests of
Just inittests ->
case tryIngredients [consoleTestReporter] mempty inittests of
Nothing -> error "No tests found!?"
Just act -> unlessM act $
error "init tests failed! cannot continue"
Nothing -> return ()
release _ = noop
setTestMode :: TestMode -> IO ()