-
-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow benchmark classes and methods to be executed using TestDriven.Net #259
Conversation
…nner to use when targeting benchmarks in the sample project. This allows a benchmark class or method to be executed using TestDriven.Net's 'Run Test(s)' command.
…hmarkTestRunner...]. Allow ConfigType to be specified using [assembly: BenchmarkTestRunner(typeof(MyConfig))].
Added myself to package owners, authors and copyright for this `project.json`. (not sure what etiquette here is, let me know if I've made a faux pas!)
I'm not sure why this build is broken:
I thought Any ideas? |
Hi @jcansdale,
|
@AndreyAkinshin I understand not wanting this in the core repo, but what about hosting it under PerfDotNet? Maybe a "Contrib" or "3rd party Integration" section or something like that? It would be nice to have things like this hosted in one place, so they're easy to find, what do you think? |
@mattwarren, let me think about it. |
I'm fortunate that the xUnit guys use TestDriven.Net, so dogfood an ITestRunner implementation as part of their core repo: For NUnit I maintain a repo as part of the NUnit organization: This is what @mattwarren is suggesting and also works well. As much as anything I want to give the BenchmarkDotNet team an opportunity to beat my up if I'm doing it wrong or abusing your interfaces. 😉
I certainly don't want to encourage bad practice, but have found the ability to quickly preview a benchmark to be useful. The alternative is to require the user to come up with their own quick benchmark attributes and remember to swap them out when they're done developing the benchmark. |
Ok, it makes sense. Probably, a separated repo under |
This branch adds support for executing benchmarks using TestDriven.Net. To try it, simply reference the
BenchmarkDotNet.TestDriven
package and add an attribute like this:If you have TestDriven.Net installed, you can then right-click
Run Test(s)
inside any class or method that contains a[Benchmark]
attribute.I've added one of these attributes to the
BenchmarkDotNet.Samples
project so you can try it there:https://github.com/jcansdale/BenchmarkDotNet/blob/master/samples/BenchmarkDotNet.Samples/Properties/AssemblyInfo.cs
Thanks for a great tool and let me know if you have any questions. 😄