summaryrefslogtreecommitdiffhomepage
path: root/Tests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Tests.hs')
-rw-r--r--Tests.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Tests.hs b/Tests.hs
index 1b9bd0e..7955c7f 100644
--- a/Tests.hs
+++ b/Tests.hs
@@ -8,6 +8,7 @@
module Tests where
import Types
+import Output
import Tunables
import Encryption
import Share
@@ -16,7 +17,6 @@ import Storage.Local
import Control.Exception
import System.Directory
import System.Posix.Temp
-import System.IO
import qualified Data.ByteString.UTF8 as BU8
import qualified Data.ByteString as B
import qualified Data.Set as S
@@ -36,22 +36,21 @@ testFailed = return . Left
runTest :: Test -> IO Bool
runTest (d, t) = do
- putStr $ "testing: " ++ show d ++ " ..."
- hFlush stdout
+ progress $ "testing: " ++ show d ++ " ..."
r <- t
case r of
Right () -> do
- putStrLn "ok"
+ say "ok"
return True
Left e -> do
- putStrLn $ "failed: " ++ show e
+ say $ "failed: " ++ show e
return False
runTests :: IO ()
runTests = do
r <- mapM runTest tests
if all (== True) r
- then putStrLn "All tests succeeded."
+ then say "All tests succeeded."
else error "Tests failed. Report a bug!"
tests :: [Test]