Skip to content

Provide some output if no benchmarks found #1899

Closed

Description

@dpuza-formativ

My first time using it, I built it, ran it, and there was nothing. No output at all.

I figured out that my template generated "class Program" and that by changing that to "public class Program" it was able to "see" the Benchmark attributes and run normally. But it would have been helpful to have some kind of message rather than zero output which was a bit confusing and off-putting for a first impression.

Activity

  1. YegorStepanov commented on Jan 29, 2022

    @YegorStepanov
    Contributor

    @dpuza-formativ Сan you share the code?

    I tried reproduce it, but:

    BenchmarkRunner.Run<Program>();
    //Gives:
    //Program containing Benchmark method MySuperBenchmarkMethod has incorrect access modifiers.
    //Declaring type must be public.
    BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
    //Gives:
    //No benchmarks to choose from. Make sure you provided public non-sealed non-static types with public [Benchmark] methods.
  2. dpuza-formativ commented on Jan 31, 2022

    @dpuza-formativ
    Author
  3. emanuel-v-r commented on Oct 13, 2022

    @emanuel-v-r
    Contributor

    Is this still an issue? If it is, can I grab it?

  4. YegorStepanov commented on Oct 13, 2022

    @YegorStepanov
    Contributor

    @emanuel-v-r the PR exists, and I think everything is fine with it

  5. filzrev commented on Aug 14, 2026

    @filzrev
    Contributor

    This issue seems be resolved by PR #2718.

  6. added this to the v0.15.0 milestone on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions