Skip to content

Commit

Permalink
Only run benchmarks specified as build targets (closes #1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
luigy committed Nov 25, 2015
1 parent 7a004b4 commit a1ff11f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Other enhancements:
[#508](https://github.com/commercialhaskell/stack/issues/508)
* Support for packages located in Mercurial repositories
[#1397](https://github.com/commercialhaskell/stack/issues/1397)
* Only run benchmarks specified as build targets
[#1412](https://github.com/commercialhaskell/stack/issues/1412)

Bug fixes:

Expand Down
8 changes: 4 additions & 4 deletions src/Stack/Build/Execute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,7 @@ toActions installedMap runInBase ee (mbuild, mfinal) =
unless (Set.null tests) $ do
singleTest runInBase topts (Set.toList tests) ac ee task installedMap
unless (Set.null benches) $ do
-- FIXME: shouldn't this use the list of benchmarks to run?
singleBench runInBase beopts ac ee task installedMap
singleBench runInBase beopts (Set.toList benches) ac ee task installedMap
}
]
where
Expand Down Expand Up @@ -1254,17 +1253,18 @@ singleTest runInBase topts testsToRun ac ee task installedMap = do
singleBench :: M env m
=> (m () -> IO ())
-> BenchmarkOpts
-> [Text]
-> ActionContext
-> ExecuteEnv
-> Task
-> InstalledMap
-> m ()
singleBench runInBase beopts ac ee task installedMap = do
singleBench runInBase beopts benchesToRun ac ee task installedMap = do
-- FIXME: Since this doesn't use cabal, we should be able to avoid using a
-- fullblown 'withSingleContext'.
(allDepsMap, _cache) <- getConfigCache ee task installedMap False True
withSingleContext runInBase ac ee task (Just allDepsMap) (Just "bench") $ \_package _cabalfp _pkgDir cabal announce _console _mlogFile -> do
let args = maybe []
let args = map T.unpack benchesToRun <> maybe []
((:[]) . ("--benchmark-options=" <>))
(beoAdditionalArgs beopts)

Expand Down

0 comments on commit a1ff11f

Please sign in to comment.