diff --git a/brittany.cabal b/brittany.cabal index 332ca76..4d43fcc 100644 --- a/brittany.cabal +++ b/brittany.cabal @@ -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 diff --git a/src-literatetests/Main.hs b/src-literatetests/Main.hs index 8f492d1..1196a56 100644 --- a/src-literatetests/Main.hs +++ b/src-literatetests/Main.hs @@ -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)