packages feed

horde-ad-0.3.0.0: test/ParallelTest.hs

module Main (main) where

import Prelude

import Data.Proxy
import System.IO qualified as SIO
import Test.Tasty
import Test.Tasty.Options
import Test.Tasty.Runners

import EqEpsilon
import TestConvQuickCheck qualified
import TestMnistCNNR qualified
import TestMnistCNNS qualified
import TestMnistFCNNR qualified
import TestMnistRNNR qualified
import TestMnistRNNS qualified

main :: IO ()
main = do
  -- Limit interleaving of characters in parallel tests.
  SIO.hSetBuffering SIO.stdout SIO.LineBuffering
  SIO.hSetBuffering SIO.stderr SIO.LineBuffering
  opts <- parseOptions (ingredients : defaultIngredients) tests
  setEpsilonEq (lookupOption opts :: EqEpsilon)
  defaultMainWithIngredients (ingredients : defaultIngredients) tests
 where
  ingredients = includingOptions [Option (Proxy :: Proxy EqEpsilon)]

tests :: TestTree
tests =
  testGroup "The set of tests for horde-ad that can be run in parallel"
    [ testGroup "Long_tests"
        (TestConvQuickCheck.testTrees
         ++ TestMnistCNNR.testTrees
         ++ TestMnistCNNS.testTrees
         ++ TestConvQuickCheck.testTrees  -- saturates cores to prevent OOM
         ++ TestMnistFCNNR.testTrees
         ++ TestConvQuickCheck.testTrees
         ++ TestMnistRNNR.testTrees
         ++ TestConvQuickCheck.testTrees
         ++ TestMnistRNNS.testTrees)
    ]