0

I have a bunch of benchmarks and I want to run a specific benchmark among them.

I had asked a previous similar question for tests. But the same technique does not work for benchmarks. Here are somethings I tried, where "benchmarkGroupName/benchmName" is the .

cabal test Module.Name.Here --benchmark-options="--match=\"<match-string>\""
cabal test Module.Name.Here --match=<match-string>
cabal test Module.Name.Here --benchmark-options="--pattern=\"<match-string>\""

It says something like

Invalid option `--match'

Usage: Module.Name.Here [-p|--pattern PATTERN] [-t|--timeout DURATION] 
                           [--stream-size ARG] [-l|--list-tests] 
                           [-j|--num-threads NUMBER] [-q|--quiet] 
                           [--hide-successes] [--color never|always|auto] 
                           [--ansi-tricks ARG] [--baseline ARG] [--csv ARG] 
                           [--svg ARG] [--stdev ARG] [--fail-if-slower ARG] 
                           [--fail-if-faster ARG]

Nothing works I've also looked at the documentation but it's not helpful.

twitu
  • 553
  • 6
  • 12
  • This works for me: `cabal bench --benchmark-options="--pattern \"test\""` (also with `=`) – Noughtmare May 20 '22 at 12:45
  • 2
    You can do `cabal bench --benchmark-options="--help"` to see all options. – Noughtmare May 20 '22 at 12:45
  • Hmmm this is does work if I use `benchName` only. But when I give `benchGroup/benchName` it fails saying cannot parse pattern. Surely there must be a way to give the path? – twitu May 20 '22 at 13:20
  • 2
    Patterns are awk expressions, see [the tasty documentation](https://github.com/UnkindPartition/tasty#patterns). You need to use `.` instead of `/`, so `benchGroup.benchName`. – Noughtmare May 20 '22 at 17:36

0 Answers0