diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-25 15:52:28 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-25 15:52:28 -0400 |
commit | e6607016d2d1381a2c4f9b89f4a43641d9261c05 (patch) | |
tree | 8ef88ad381ee8543be8c92e75a4847bb0e5b204f /Command/FuzzTest.hs | |
parent | 20fec383954b45026b3880ee89ccc755d75fdbfe (diff) |
make fuzz test also output its actions to stdout
Diffstat (limited to 'Command/FuzzTest.hs')
-rw-r--r-- | Command/FuzzTest.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Command/FuzzTest.hs b/Command/FuzzTest.hs index c01654462..d038c82d3 100644 --- a/Command/FuzzTest.hs +++ b/Command/FuzzTest.hs @@ -53,17 +53,18 @@ guardTest = unlessM (fromMaybe False . Git.Config.isTrue <$> getConfig key "") $ fuzz :: Handle -> Annex () fuzz logh = do action <- genFuzzAction - liftIO $ do - now <- getCurrentTime - hPrint logh $ Started now action - hFlush logh + record logh $ flip Started action result <- tryAnnex $ runFuzzAction action - liftIO $ do - now <- getCurrentTime - hPrint logh $ - Finished now $ - either (const False) (const True) result - hFlush logh + record logh $ flip Finished $ + either (const False) (const True) result + +record :: Handle -> (UTCTime -> TimeStampedFuzzAction) -> Annex () +record h tmpl = liftIO $ do + now <- getCurrentTime + let s = show $ tmpl now + print s + hPrint h s + hFlush h {- Delay for either a fraction of a second, or a few seconds, or up - to 1 minute. -} |