diff --git a/examples/end-to-end-benchmarks.hs b/examples/end-to-end-benchmarks.hs index 994a7ed..05fc69e 100755 --- a/examples/end-to-end-benchmarks.hs +++ b/examples/end-to-end-benchmarks.hs @@ -20,7 +20,7 @@ benchmarks = main :: IO () main = defaultMainWith config "hyperion-example-end-to-end" benchmarks where - config = defaultConfig + config = defaultConfigMonoid { configMonoidSamplingStrategy = pure $ timeBound (fromSeconds 5) (repeat 10) } diff --git a/src/Hyperion/Main.hs b/src/Hyperion/Main.hs index 3eec811..f2a94eb 100644 --- a/src/Hyperion/Main.hs +++ b/src/Hyperion/Main.hs @@ -8,11 +8,15 @@ module Hyperion.Main ( defaultMain , Mode(..) + , Config(..) , ConfigMonoid(..) , ReportOutput(..) , nullOutputPath , defaultConfig + , defaultConfigMonoid , defaultMainWith + , doAnalyze + , doRun ) where import Control.Applicative @@ -178,8 +182,11 @@ nullOutputPath = "nul" nullOutputPath = "/dev/null" #endif -defaultConfig :: ConfigMonoid -defaultConfig = mempty +defaultConfigMonoid :: ConfigMonoid +defaultConfigMonoid = mempty + +defaultConfig :: Config +defaultConfig = configFromMonoid defaultConfigMonoid data DuplicateIdentifiers a = DuplicateIdentifiers [a] instance (Show a, Typeable a) => Exception (DuplicateIdentifiers a) @@ -315,4 +322,4 @@ defaultMain :: String -- ^ Package name, user provided. -> [Benchmark] -- ^ Benchmarks to be run. -> IO () -defaultMain = defaultMainWith defaultConfig +defaultMain = defaultMainWith defaultConfigMonoid diff --git a/tests/Hyperion/MainSpec.hs b/tests/Hyperion/MainSpec.hs index 82c3d10..77f5255 100644 --- a/tests/Hyperion/MainSpec.hs +++ b/tests/Hyperion/MainSpec.hs @@ -15,8 +15,10 @@ spec = do it "checks for duplicate identifiers" $ property $ \b -> length (b^..identifiers) /= length (group (sort (b^..identifiers))) ==> expectFailure $ monadicIO $ run $ - defaultMainWith defaultConfig{configMonoidMode = return Run} "spec" [b] + defaultMainWith + defaultConfigMonoid{configMonoidMode = return Run} "spec" [b] it "Analyzes uniquely identified benchmarks" $ property $ \b -> length (b^..identifiers) == length (group (sort (b^..identifiers))) ==> monadicIO $ run $ - defaultMainWith defaultConfig{configMonoidReportOutputs = [ReportJson nullOutputPath]} "specs" [b] + defaultMainWith + defaultConfigMonoid{configMonoidReportOutputs = [ReportJson nullOutputPath]} "specs" [b]