sim: add stepstable

This commit is contained in:
Joey Hess 2024-09-24 11:47:20 -04:00
parent 4ed58d7894
commit 9571162057
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 63 additions and 20 deletions

View file

@ -42,9 +42,11 @@ seek ps = case parseSimCommand ps of
simdir <- fromRepo gitAnnexSimDir
liftIO (restoreSim simdir) >>= \case
Left err -> giveup err
Right st ->
runSimCommand simcmd repobyname st
>>= liftIO . suspendSim
Right st -> do
st' <- runSimCommand simcmd repobyname st
liftIO $ suspendSim st'
when (simFailed st' && not (simFailed st)) $
giveup "Simulation had errors."
start :: Maybe FilePath -> CommandSeek
start simfile = do
@ -68,6 +70,8 @@ start simfile = do
let st' = recordSeed st cs
st'' <- go st' repobyname cs
liftIO $ suspendSim st''
when (simFailed st'') $
giveup "Simulation had errors."
go st _ [] = return st
go st repobyname (c:cs) = do