Skip to content
Snippets Groups Projects
Commit 38937f2a authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Merge pull request #2897 from Heather/patch-5

Bench.hs: use exitSuccess and forM
parents f2278fc2 b603142d
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,8 @@ import Distribution.Simple.UserHooks ( Args )
import Distribution.Simple.Utils ( die, notice, rawSystemExitCode )
import Distribution.Text
import Control.Monad ( when, unless )
import System.Exit ( ExitCode(..), exitFailure, exitWith )
import Control.Monad ( when, unless, forM )
import System.Exit ( ExitCode(..), exitFailure, exitSuccess )
import System.Directory ( doesFileExist )
import System.FilePath ( (</>), (<.>) )
......@@ -77,9 +77,9 @@ bench args pkg_descr lbi flags = do
++ show (disp $ PD.benchmarkType bm)
exitFailure
when (not $ PD.hasBenchmarks pkg_descr) $ do
unless (PD.hasBenchmarks pkg_descr) $ do
notice verbosity "Package has no benchmarks."
exitWith ExitSuccess
exitSuccess
when (PD.hasBenchmarks pkg_descr && null enabledBenchmarks) $
die $ "No benchmarks enabled. Did you remember to configure with "
......@@ -87,7 +87,7 @@ bench args pkg_descr lbi flags = do
bmsToRun <- case benchmarkNames of
[] -> return enabledBenchmarks
names -> flip mapM names $ \bmName ->
names -> forM names $ \bmName ->
let benchmarkMap = zip enabledNames enabledBenchmarks
enabledNames = map PD.benchmarkName enabledBenchmarks
allNames = map PD.benchmarkName pkgBenchmarks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment