[[TableOfContents]]

= MFC TestRunner =

Here is a screenshot of the MFC based TestRunner:

attachment:mfctestrunner.png

The following documentation pages have more information:
 * http://cppunit.sourceforge.net/doc/lastest/_mfc_test_runner_8h-source.html
 * http://cppunit.sourceforge.net/doc/lastest/class_mfc_test_runner.html

== Microsoft Visual C++ 6.0 ==

The following page contains a good overview of the step required to build an MFC based test project:
http://www.codeproject.com/library/Using_CPPUnit.asp -- BaptisteLepilleur

In case that page goes down, here are the basic steps (please flesh them out if you have MSVC 6.0!):
 * Follow the INSTALL-WIN32.txt instructions to get the libraries built
 * Create a new MFC Application
  * Dialog based (since that appears to be the most minimal)
  * Use MFC in a shared DLL
  * Disable (almost) everything else, since it will probably be thrown out.
 * Try compiling and running, to make sure there are no issues.
 * Add cppunit.lib and testrunner.lib (or the debug versions, cppunitd.lib and testrunnerd.lib) to your Linker dependencies.  These are in the /lib folder.
 * Modify the CWin``App-derived class's Init``Instance  to call the MfcTestRunner, such as: {{{#!cplusplus

#include <cppunit/ui/mfc/MfcTestRunner.h>
#include <cppunit/extensions/TestFactoryRegistry.h>

BOOL CMyMFCApp::InitInstance()
{
	CWinApp::InitInstance();

	CppUnit::MfcTestRunner runner;
	runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
	runner.run();    

	return FALSE;
}
}}}

== Microsoft Visual C++ 7.0 ==
In 1.10.2, the test runner works, but the DSPlug``In doesn't.  This means that you get the pretty graphical test run, test selection, etc., but clicking on the error will not jump to the code.  
It appears that the test runner runs the whole suite twice as well, but that may just be my code.

However, 1.11.4 (as of March 2005, the CVS version) has a version that works, without a plugin, in MSVC 7.0:

http://cvs.sourceforge.net/viewcvs.py/cppunit/cppunit/NEWS?rev=HEAD


== Microsoft Visual C++ 8.0 ==

''anyone?''

== Dead Instructions ==
''Someday, someone will be bold enough to delete this.  Is that person you?''

My notes while playing with CppUnit in Visual Studio .NET 2003 can be found at:
http://www.componentsnotebook.com/agilehacker/blog.html#CppUnit

 > Thank you for that blog entry! It was very helpful to me after 5+ hours reading around online and in the CppUnit documentation. Using your instructions (and what I'd learned about CppUnit in general) I was able to integrate the CppUnitTestApp into my solution (in VS.NET 2003). - Darren Torpey; July 6th, 2004 

The link to the notes seems to be dead. Would you please check this? best regards Stefan Rauch, Feb. 28th, 2005

It's dead for me too, nothing in the Google cache, and the Wayback machine says the site died over a year ago.  I'll try to get it running on my box, and see if I can create some instructions.  If you have some in your back pocket, please post them here -- JohnWhitlock [[DateTime(2005-02-28T19:28:13Z)]]

Seems to be back up again.  I've archived it in case it dies again.  -- MikeHigginbottom [[DateTime(2005-05-14T23:26:00Z)]]

My hosting provider was hacked, after 2 weeks they still didn't have their DNS fixed so I switched to new provider.  I intend to keep that link active, & hopefully update the information. -- Bill Burris [[DateTime(2005-05-25T11:11:00Z)]]
