I set up a simple stack project, and a .cabal entry for the benchmark tests:
benchmark leaves-of-a-tree-bench
type: exitcode-stdio-1.0
hs-source-dirs: src, bench
main-is: MainBenchmarkSuite.hs
build-depends: base
, criterion
, random
, leaves-of-a-tree
ghc-options: -Wall
-O2
default-language: Haskell2010
However after running stack bench
I get the following error:
setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: Error: Could not find benchmark program
".stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/leaves-of-a-tree-bench/leaves-of-a-tree-bench".
Did you build the package first?
Am I missing something?
EDIT: I uploaded the project to a github repository