From 0b3363777cb4475379eb9bb86de7c3df2348f907 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 23 Oct 2014 11:05:19 +0300 Subject: [PATCH] Better error reporting --- Stackage/Test.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Stackage/Test.hs b/Stackage/Test.hs index 0fdfdbc8..ab0dba84 100644 --- a/Stackage/Test.hs +++ b/Stackage/Test.hs @@ -112,12 +112,11 @@ getCabalVersion = do notCRLF '\r' = False notCRLF _ = True -parFoldM :: (Ord key, Show key) - => Int -- ^ number of threads - -> ((key, payload) -> IO c) +parFoldM :: Int -- ^ number of threads + -> ((PackageName, payload) -> IO c) -> (a -> c -> a) -> a - -> [(key, Set key, payload)] + -> [(PackageName, Set PackageName, payload)] -> IO a parFoldM threadCount0 f g a0 bs0 = do ma <- C.newMVar a0 @@ -126,7 +125,11 @@ parFoldM threadCount0 f g a0 bs0 = do completed <- newIORef Set.empty tids <- replicateM threadCount0 $ C.forkIO $ worker completed ma mbs signal wait threadCount0 signal tids - [] <- C.takeMVar mbs -- ensure all tests were run + + unrun <- C.takeMVar mbs + when (not $ null unrun) $ + error $ "The following tests were not run: " ++ unwords + [x | (PackageName x, _, _) <- unrun] C.takeMVar ma where worker completedRef ma mbs signal =