BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

Provide some output if no benchmarks found

Open dpuza-formativ opened this issue 3 years ago • 4 comments
trafficstars

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.

dpuza-formativ avatar Jan 25 '22 17:01 dpuza-formativ

@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.

YegorStepanov avatar Jan 29 '22 20:01 YegorStepanov

@YegorStepanov

https://gist.github.com/dpuza-formativ/bf58387f438ab10c523ad905b7ac0976

dpuza-formativ avatar Jan 31 '22 14:01 dpuza-formativ

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

emanuel-v-r avatar Oct 13 '22 14:10 emanuel-v-r

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

YegorStepanov avatar Oct 13 '22 15:10 YegorStepanov