File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ benchmarks =
2020main :: IO ()
2121main = defaultMainWith config " hyperion-example-end-to-end" benchmarks
2222 where
23- config = defaultConfig
23+ config = defaultConfigMonoid
2424 { configMonoidSamplingStrategy =
2525 pure $ timeBound (fromSeconds 5 ) (repeat 10 )
2626 }
Original file line number Diff line number Diff line change 88module Hyperion.Main
99 ( defaultMain
1010 , Mode (.. )
11+ , Config (.. )
1112 , ConfigMonoid (.. )
1213 , ReportOutput (.. )
14+ , configFromMonoid
1315 , nullOutputPath
1416 , defaultConfig
17+ , defaultConfigMonoid
1518 , defaultMainWith
19+ , doAnalyze
20+ , doRun
1621 ) where
1722
1823import Control.Applicative
@@ -178,8 +183,11 @@ nullOutputPath = "nul"
178183nullOutputPath = " /dev/null"
179184#endif
180185
181- defaultConfig :: ConfigMonoid
182- defaultConfig = mempty
186+ defaultConfigMonoid :: ConfigMonoid
187+ defaultConfigMonoid = mempty
188+
189+ defaultConfig :: Config
190+ defaultConfig = configFromMonoid defaultConfigMonoid
183191
184192data DuplicateIdentifiers a = DuplicateIdentifiers [a ]
185193instance (Show a , Typeable a ) => Exception (DuplicateIdentifiers a )
@@ -315,4 +323,4 @@ defaultMain
315323 :: String -- ^ Package name, user provided.
316324 -> [Benchmark ] -- ^ Benchmarks to be run.
317325 -> IO ()
318- defaultMain = defaultMainWith defaultConfig
326+ defaultMain = defaultMainWith defaultConfigMonoid
Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ spec = do
1515 it " checks for duplicate identifiers" $ property $ \ b ->
1616 length (b^.. identifiers) /= length (group (sort (b^.. identifiers))) ==>
1717 expectFailure $ monadicIO $ run $
18- defaultMainWith defaultConfig{configMonoidMode = return Run } " spec" [b]
18+ defaultMainWith
19+ defaultConfigMonoid{configMonoidMode = return Run } " spec" [b]
1920 it " Analyzes uniquely identified benchmarks" $ property $ \ b ->
2021 length (b^.. identifiers) == length (group (sort (b^.. identifiers))) ==>
2122 monadicIO $ run $
22- defaultMainWith defaultConfig{configMonoidReportOutputs = [ReportJson nullOutputPath]} " specs" [b]
23+ defaultMainWith
24+ defaultConfigMonoid{configMonoidReportOutputs = [ReportJson nullOutputPath]} " specs" [b]
You can’t perform that action at this time.
0 commit comments