I wonder if it is possible to run performance testing based on xUnit?
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.
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 ;)
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.
Now there is a project on Github : https://github.com/Microsoft/xunit-performance
It provides extensions over xUnit to author performance tests (benchmark).
© 2022 - 2024 — McMap. All rights reserved.