on master help sign in
Better error reporting
0b33637Michael Snoyman
Stackage/Test.hs+8−5
@@ -112,12 +112,11 @@ getCabalVersion = do
112 notCRLF '\r' = False
112 notCRLF '\r' = False
113 notCRLF _ = True
113 notCRLF _ = True
114
114
115−parFoldM :: (Ord key, Show key)
116− => Int -- ^ number of threads
115+parFoldM :: Int -- ^ number of threads
117− -> ((key, payload) -> IO c)
116+ -> ((PackageName, payload) -> IO c)
118 -> (a -> c -> a)
117 -> (a -> c -> a)
119 -> a
118 -> a
120− -> [(key, Set key, payload)]
119+ -> [(PackageName, Set PackageName, payload)]
121 -> IO a
120 -> IO a
122parFoldM threadCount0 f g a0 bs0 = do
121parFoldM threadCount0 f g a0 bs0 = do
123 ma <- C.newMVar a0
122 ma <- C.newMVar a0
@@ -126,7 +125,11 @@ parFoldM threadCount0 f g a0 bs0 = do
126 completed <- newIORef Set.empty
125 completed <- newIORef Set.empty
127 tids <- replicateM threadCount0 $ C.forkIO $ worker completed ma mbs signal
126 tids <- replicateM threadCount0 $ C.forkIO $ worker completed ma mbs signal
128 wait threadCount0 signal tids
127 wait threadCount0 signal tids
128+
129− [] <- C.takeMVar mbs -- ensure all tests were run
129+ unrun <- C.takeMVar mbs
130+ when (not $ null unrun) $
131+ error $ "The following tests were not run: " ++ unwords
132+ [x | (PackageName x, _, _) <- unrun]
130 C.takeMVar ma
133 C.takeMVar ma
131 where
134 where
132 worker completedRef ma mbs signal =
135 worker completedRef ma mbs signal =