Run tests in prallel
parent
48482c59a6
commit
9d7cecaa92
|
@ -335,8 +335,9 @@ test-suite littests
|
||||||
ghc-options: {
|
ghc-options: {
|
||||||
-Wall
|
-Wall
|
||||||
-fno-warn-unused-imports
|
-fno-warn-unused-imports
|
||||||
|
-threaded
|
||||||
-rtsopts
|
-rtsopts
|
||||||
-with-rtsopts "-M2G"
|
-with-rtsopts "-M2G -N"
|
||||||
}
|
}
|
||||||
|
|
||||||
test-suite libinterfacetests
|
test-suite libinterfacetests
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
{-# LANGUAGE QuasiQuotes #-}
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
|
|
||||||
module Main where
|
module Main (main) where
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "prelude.inc"
|
#include "prelude.inc"
|
||||||
|
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
|
import Test.Hspec.Runner ( hspecWith, defaultConfig, configConcurrentJobs )
|
||||||
|
|
||||||
import NeatInterpolation
|
import NeatInterpolation
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ import Language.Haskell.Brittany.Internal.Config.Types
|
||||||
import Language.Haskell.Brittany.Internal.Config
|
import Language.Haskell.Brittany.Internal.Config
|
||||||
|
|
||||||
import Data.Coerce ( coerce )
|
import Data.Coerce ( coerce )
|
||||||
|
import GHC.Conc ( getNumCapabilities )
|
||||||
|
|
||||||
import qualified Data.Text.IO as Text.IO
|
import qualified Data.Text.IO as Text.IO
|
||||||
import System.FilePath ( (</>) )
|
import System.FilePath ( (</>) )
|
||||||
|
@ -48,7 +50,8 @@ main = do
|
||||||
let groups = createChunks =<< inputs
|
let groups = createChunks =<< inputs
|
||||||
inputCtxFree <- Text.IO.readFile "src-literatetests/30-tests-context-free.blt"
|
inputCtxFree <- Text.IO.readFile "src-literatetests/30-tests-context-free.blt"
|
||||||
let groupsCtxFree = createChunks inputCtxFree
|
let groupsCtxFree = createChunks inputCtxFree
|
||||||
hspec $ do
|
jobs <- getNumCapabilities
|
||||||
|
hspecWith (defaultConfig { configConcurrentJobs = Just jobs }) $ do
|
||||||
groups `forM_` \(groupname, tests) -> do
|
groups `forM_` \(groupname, tests) -> do
|
||||||
describe (Text.unpack groupname) $ tests `forM_` \(name, pend, inp) -> do
|
describe (Text.unpack groupname) $ tests `forM_` \(name, pend, inp) -> do
|
||||||
(if pend then before_ pending else id)
|
(if pend then before_ pending else id)
|
||||||
|
|
Loading…
Reference in New Issue