Run tests in prallel

pull/186/head
Sergey Vinokurov 2018-04-04 09:26:59 +01:00
parent 48482c59a6
commit 9d7cecaa92
No known key found for this signature in database
GPG Key ID: D6CD29530F98D6B8
2 changed files with 7 additions and 3 deletions

View File

@ -335,8 +335,9 @@ test-suite littests
ghc-options: {
-Wall
-fno-warn-unused-imports
-threaded
-rtsopts
-with-rtsopts "-M2G"
-with-rtsopts "-M2G -N"
}
test-suite libinterfacetests

View File

@ -1,12 +1,13 @@
{-# LANGUAGE QuasiQuotes #-}
module Main where
module Main (main) where
#include "prelude.inc"
import Test.Hspec
import Test.Hspec.Runner ( hspecWith, defaultConfig, configConcurrentJobs )
import NeatInterpolation
@ -22,6 +23,7 @@ import Language.Haskell.Brittany.Internal.Config.Types
import Language.Haskell.Brittany.Internal.Config
import Data.Coerce ( coerce )
import GHC.Conc ( getNumCapabilities )
import qualified Data.Text.IO as Text.IO
import System.FilePath ( (</>) )
@ -48,7 +50,8 @@ main = do
let groups = createChunks =<< inputs
inputCtxFree <- Text.IO.readFile "src-literatetests/30-tests-context-free.blt"
let groupsCtxFree = createChunks inputCtxFree
hspec $ do
jobs <- getNumCapabilities
hspecWith (defaultConfig { configConcurrentJobs = Just jobs }) $ do
groups `forM_` \(groupname, tests) -> do
describe (Text.unpack groupname) $ tests `forM_` \(name, pend, inp) -> do
(if pend then before_ pending else id)