Performance Testing using xUnit framework
-
28-09-2019 - |
Question
I wonder if it is possible to run performance testing based on xUnit?
Solution
For JUnit, you might look at JUnitPerf.
If you're working in a different language and a different xUnit, the JunitPerf design concept (decorating normal JUnit tests) and code might give ideas of how to do the same in your language.
OTHER TIPS
Not sure what exactly you asking, but you can easily write your own custom attribute to do that. For an example..
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class TraceAttribute : BeforeAfterTestAttribute
{
public override void Before(MethodInfo methodUnderTest)
{
//Start timer
}
public override void After(MethodInfo methodUnderTest)
{
//End timer
}
}
Then decorate your Unit Test with the this attribute. Also make sure you write to an output ;)
Now there is a project on Github : https://github.com/Microsoft/xunit-performance
It provides extensions over xUnit to author performance tests (benchmark).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow