Run tests in prallel
parent
48482c59a6
commit
9d7cecaa92
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue