fho
fho

Reputation: 6798

How to use stack bench?

Just tried to run the benchmarks on a project that I have converted from cabal to stack. Running stack bench just prints out project-name-version: benchmarks with no further output. Do I have to pass additional flags to stack to see the criterion output?

benchmark section for reference:

benchmark mainbench
  type:             exitcode-stdio-1.0
  hs-source-dirs:   src, bench
  main-is:          MainBench.hs
  build-depends:    base,
                    vector,
                    linear,
                    hmatrix,
                    hmatrix-gsl,
                    criterion,
                    random,
                    MonadRandom
  ghc-options:      -Wall
                    -O2
  default-language: Haskell2010

Edit: this is on stack-0.1.6.0

(This is no duplicate of How to use stack bench :) )

Upvotes: 5

Views: 2690

Answers (1)

ErikR
ErikR

Reputation: 52029

I think there is something amiss with your setup. This is typical output (project name is bennie, benchmark name is bennie-mark):

$ stack bench
bennie-0.1.0.0: benchmarks
Running 1 benchmarks...
Benchmark bennie-mark: RUNNING...
... output of bennie-mark ...
Benchmark bennie-mark: FINISH

This is with stack-0.1.6.0. Perhaps try upgrading/reinstalling stack. Maybe try stack -v bench.

Upvotes: 3

Related Questions