From c938074358f462d0bf4f008ff92d684ba364927e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 Feb 2013 23:35:37 -0400 Subject: [PATCH] improve test output --- Test.hs | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/Test.hs b/Test.hs index 94f77ac07d..820b99a44e 100644 --- a/Test.hs +++ b/Test.hs @@ -56,17 +56,36 @@ import qualified Utility.InodeCache main :: IO () main = do - unlessM (all isSuccess <$> sequence quickcheck) $ - error "A quickcheck test failed!" + divider + putStrLn "First, some automated quick checks of properties ..." + divider + qcok <- all isSuccess <$> sequence quickcheck + divider + putStrLn "Now, some broader checks ..." + putStrLn " (Do not be alarmed by odd output here; it's normal." + putStrLn " wait for the last line to see how it went.)" + divider prepare r <- runTestTT blackbox cleanup tmpdir - propigate r + divider + propigate r qcok + where + divider = putStrLn $ take 70 $ repeat '-' -propigate :: Counts -> IO () -propigate Counts { errors = e , failures = f } - | e+f > 0 = error "failed" - | otherwise = return () +propigate :: Counts -> Bool -> IO () +propigate Counts { errors = e , failures = f } qcok + | blackboxok && qcok = putStrLn "All tests ok." + | otherwise = do + unless qcok $ + putStrLn "Quick check tests failed! This is a bug in git-annex." + unless blackboxok $ do + putStrLn "Some tests failed!" + putStrLn " (This could be due to a bug in git-annex, or an incompatability" + putStrLn " with utilities, such as git, installed on this system.)" + exitFailure + where + blackboxok = e+f == 0 quickcheck :: [IO Result] quickcheck =