Forum Discussion

hnguyen_1's avatar
hnguyen_1
Occasional Contributor
11 years ago

Feasibility and how-to profile coverage for C++ code by running C# tests via NUnit

Hi,



Our server code is written in C++.

Our test code is written in C# .NET 4, using libraries that will make HTTP calls to the server.

We run the tests via NUnit.

Is it possible for us to get test coverage for the server code from the NUnit test runs? If so, how should we set it up (a rough outline will do, I will search the details based on the ideas you've specified).



Hope to see a reply soon.

Thank you in advance.

1 Reply

  • aqAnt's avatar
    aqAnt
    SmartBear Alumni (Retired)


    Hi Huong,



    AQtime can profile both native and managed code. So, you can perform coverage testing of your server application. To do this, configure the Coverage profiler for your application and run the profiling when you start your tests from the client side. Please go through the Coverage Profiler Tutorial - it contains the information you need.



    If you also need to get your unit tests' code coverage, you can profile your test assemblies that are loaded to the nunit.exe or nunit-console.exe process as described in the Profiling .NET Applications article. One thing should be noted: by default, NUnit copies assemblies with tests to temporary folders and loads the assemblies from the folders, so, in fact, both nunit.exe and nunit-console.exe processes do not load original assemblies. I suggest that you disable the Enable Shadow Copy option in the GUI NUnit program (Tools | Settings... | Test Loader | Advanced) and specify the /noshadow option for the nunit-console program to prevent this behavior.



    I hope this helps.