开发者

Is there a way to use EQATEC profiler on my NUnit Unit tests?

开发者 https://www.devze.com 2023-03-08 20:53 出处:网络
I\'d like to use the EQATEC profiler on my NUnit unit tests, just like I used to do with JetBrains dotTrace in conjunction with TestDriven.NET and NUnit. Is ther开发者_StackOverflow中文版e a way to do

I'd like to use the EQATEC profiler on my NUnit unit tests, just like I used to do with JetBrains dotTrace in conjunction with TestDriven.NET and NUnit. Is ther开发者_StackOverflow中文版e a way to do this? As it is, it seems that I need to wrap my UnitTest in a console app and then use the profiler on that.


EQATEC Profiler is actually quite suited for automation: it has a command-line version and an API with which you can control most aspects of the profiling, and you'll simply have to use that in your unit-tests.

The API is described in the profiler's user guide. What you want to do is probably something like this:

  1. First add a reference to the profiler-API. You'll find assemblies for four different platforms in the installed RuntimeDLL-folder. You're probably looking for EQATEC.Profiler.RuntimeFullNet.dll, but there are also implementations for NetCF, Silverlight, and WP7.
  2. Now you can add code to your unit-tests to take timing-snapshots whenever you want to and have them saved to a file of your choice using the EQATEC.Profiler.Runtime.TakeSnapshot() methods. Those report-files can later be inspected in the profiler.

Remember that you still need to instrument your compiled unit-test with the profiler and run the instrumented versions, but this can be automated with the command-line version of the profiler, EQATECProfilerCmd.exe. It's really simply to use and goes like this:

EQATECProfilerCmd -build <your app directory>


I like to use build variables in my Post-build event command line in Visual Studio. The EQATECProfilerCmd does not like a backslash at the end of the path, so I do this:

"C:\Program Files (x86)\EQATEC\EQATECProfiler\EQATECProfilerCmd" -build "$(TargetDir)."

Note how I included a period at the end of the command. Also note how I put quotes around the path because I know there are spaces in the path.

0

精彩评论

暂无评论...
验证码 换一张
取 消