There are couple possible solutions to the problem.
One would be if you could place your static library in a DLL for the purposes of unit testing. The easiest way to do that would be to make a special build which exports all of the classes, methods and data, perhaps using a macro. This is along the lines of how MFC and ATL sources are built.
A second option is to make use of the /dumpfuncs and /exclude command line options to vsinstr.exe. You could first use /dumpfuncs on your test DLL, and then you could construct appropriate /exclude's, perhaps with wildcards, to prevent that code from being instrumented. This second option is obviously a lot more fragile than the first because you will have to keep the exclude's up-to-date as your unit tests change.
We are considering adding much richer filtering functionality in the Orcas timeframe.
Thanks for using VSTS 2005!
|