Blame INSTALL-WIN32.txt

Packit 8c9aa0
Frequently Asked Questions: See doc/FAQ
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
At the current time, the only supported WIN32 platform is 
Packit 8c9aa0
Microsoft Visual C++. You must have VC++ 6.0 at least.
Packit 8c9aa0

Packit 8c9aa0
Quick Steps to compile & run a sample using the GUI TestRunner:
Packit 8c9aa0
- Open examples/examples.dsw in VC++ (contains all the samples).
Packit 8c9aa0
  VC7 will ask you if you want to convert, anwser 'yes to all'.
Packit 8c9aa0
- Make HostApp the Active project
Packit 8c9aa0
- Compile
Packit 8c9aa0
- Run the project
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
Project build Target:
Packit 8c9aa0
---------------------
Packit 8c9aa0

Packit 8c9aa0
Framework & tools:
Packit 8c9aa0

Packit 8c9aa0
* cppunit (cppunit.lib) : unit testing framework library, the one you use 
Packit 8c9aa0
to write unit tests.
Packit 8c9aa0

Packit 8c9aa0
* cppunit_dll(cppunit_dll.dll/lib) : same as above, but build as a DLL.
Packit 8c9aa0

Packit 8c9aa0
* DllPlugInTester(DllPlugInTester.exe) : test plug-in runner executable.
Packit 8c9aa0
Use this to test DLL in your post-build step, or debug them.
Packit 8c9aa0

Packit 8c9aa0
* TestRunner (testrunner.dll) : a MFC extension DLL to run and browser unit 
Packit 8c9aa0
tests from a GUI.
Packit 8c9aa0

Packit 8c9aa0
* TestPlugInRunner : (Warning: experimental) a VC++ 
Packit 8c9aa0
application to run test plug-in. A test plug-in is a DLL that publish a 
Packit 8c9aa0
specified interface. This application is still incomplete (the auto-reload 
Packit 8c9aa0
feature is missing).
Packit 8c9aa0

Packit 8c9aa0
All libraries are placed in the lib/ directory.
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
Examples:
Packit 8c9aa0
---------
Packit 8c9aa0

Packit 8c9aa0
* CppUnitTestMain : the actual test suite use to test CppUnit. Use a 
Packit 8c9aa0
TextTestRunner, and post-build testing with CompilterOutputter. Configuration
Packit 8c9aa0
to link against cppunit static library and cppunit dll library.
Packit 8c9aa0

Packit 8c9aa0
* CppUnitTestApp : contains the same test suite as CppUnitTestMain, but
Packit 8c9aa0
run them using the MFC TestRunner.
Packit 8c9aa0

Packit 8c9aa0
* hierarchy : a sample demonstrating how to sublcass test (you might rather
Packit 8c9aa0
want to use HelperMacros.h and the CPPUNIT_TEST_SUB_SUITE macro which does
Packit 8c9aa0
it in a 'cleaner' way. That sample has not been updated for a long time).
Packit 8c9aa0

Packit 8c9aa0
* HostApp : a sample using the MFC TestRunner demonstrating different test
Packit 8c9aa0
failure. Also demonstrates the MFC Unicode TestRunner.
Packit 8c9aa0

Packit 8c9aa0
* Money : an example that come along with the Money article of the 
Packit 8c9aa0
documentation. Probably what you want to look at if you are a newbie.
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
Configuration:
Packit 8c9aa0
--------------
Packit 8c9aa0

Packit 8c9aa0
CppUnit and TestRunner comes with 3 configurations.
Packit 8c9aa0

Packit 8c9aa0
* Release (): Multihtreaded DLL, release mode
Packit 8c9aa0
* Debug (d): Debug Multithreaded DLL, debug mode
Packit 8c9aa0
* Unicode Release (u): Unicode Multihtreaded DLL, release mode
Packit 8c9aa0
* Unicode Debug (ud): Unicode Debug Multithreaded DLL, debug mode
Packit 8c9aa0

Packit 8c9aa0
For CppUnit, when building as dll, "dll" is appended to the 'suffix'.
Packit 8c9aa0

Packit 8c9aa0
The letters enclosed in brackets indicates the suffix added to
Packit 8c9aa0
the library name. For example, the debug configuration cppunit static library
Packit 8c9aa0
name is cppunitd.lib. The debug configuration cppunit dll name is cppunitd_dll.lib.
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
Building:
Packit 8c9aa0
---------
Packit 8c9aa0

Packit 8c9aa0
* Open the src/CppUnitLibraries.dsw workspace in VC++.
Packit 8c9aa0
* In the 'Build' menu, select 'Batch Build...'
Packit 8c9aa0
* In the batch build dialog, select all projects and press the build button.
Packit 8c9aa0
* The resulting libraries can be found in the lib/ directory.
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
Testing:
Packit 8c9aa0
--------
Packit 8c9aa0

Packit 8c9aa0
* Open the workspace examples/Examples.dsw.
Packit 8c9aa0
* Make CppUnitTestApp the active project.
Packit 8c9aa0
* Select the configuration you build the library for.
Packit 8c9aa0
* Compile and run the project. The TestRunner GUI should appear.
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
Libraries:
Packit 8c9aa0
----------
Packit 8c9aa0

Packit 8c9aa0
All the compiled libraries and DLL can be found in the 'lib' directory.
Packit 8c9aa0
Most libraries can be build from src/CppUnitLibraries.dsw workspace.
Packit 8c9aa0

Packit 8c9aa0
lib\:
Packit 8c9aa0
cppunit.lib				: CppUnit static library "Multithreaded DLL"
Packit 8c9aa0
cppunitd.lib			: CppUnit static library "Debug Multithreaded DLL"
Packit 8c9aa0
cppunit_dll.dll			: CppUnit dynamic library (DLL) "Multithreaded DLL"
Packit 8c9aa0
cppunit_dll.lib			: CppUnit dynamic import library "Multithreaded DLL"
Packit 8c9aa0
cppunitd_dll.dll		: CppUnit dynamic library (DLL) "Debug Multithreaded DLL"
Packit 8c9aa0
cppunitd_dll.lib		: CppUnit dynamic import library "Debug Multithreaded DLL"
Packit 8c9aa0
testrunner.dll			: MFC TestRunner dynamic library (DLL) "Multithreaded DLL"
Packit 8c9aa0
testrunner.lib			: MFC TestRunner import library "Multithreaded DLL"
Packit 8c9aa0
testrunnerd.dll			: MFC TestRunner dynamic library (DLL) "Debug Multithreaded DLL"
Packit 8c9aa0
testrunnerd.lib			: MFC TestRunner import library "Debug Multithreaded DLL"
Packit 8c9aa0
testrunneru.dll			: MFC Unicode TestRunner dynamic library (DLL) "Multithreaded DLL"
Packit 8c9aa0
testrunneru.lib			: MFC Unicode TestRunner import library "Multithreaded DLL"
Packit 8c9aa0
testrunnerud.dll		: MFC Unicode TestRunner dynamic library (DLL) "Debug Multithreaded DLL"
Packit 8c9aa0
testrunnerud.lib		: MFC Unicode TestRunner import library "Debug Multithreaded DLL"
Packit 8c9aa0

Packit 8c9aa0
Notes that when you are using CppUnit DLL (cppunit*_dll.dll), you must link 
Packit 8c9aa0
against the associated import library and define the pre-processor symbol 
Packit 8c9aa0
CPPUNIT_DLL in your project.
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
Tools:
Packit 8c9aa0
------
Packit 8c9aa0

Packit 8c9aa0
CppUnit provides a generic test runner for test plug-in: DllPlugInTester.
Packit 8c9aa0
It can be found in the lib/ directory. It requires cppunit*_dll.dll
Packit 8c9aa0

Packit 8c9aa0
lib/:
Packit 8c9aa0
DllPlugInTester_dll.exe  : test plug-in runner, "Multithreaded DLL", cppunit_dll.dll
Packit 8c9aa0
DllPlugInTesterd_dll.exe : test plug-in runner, "Debug Multithreaded DLL", cppunitd_dll.dll
Packit 8c9aa0
DllPlugInTester.exe  : test plug-in runner, "Multithreaded DLL", static link cppunit.lib
Packit 8c9aa0
DllPlugInTesterd.exe : test plug-in runner, "Debug Multithreaded DLL", static link cppunitd.lib
Packit 8c9aa0

Packit 8c9aa0
Notes that the DllPlugInTester(d).exe version of this tools does not allow
Packit 8c9aa0
to use the automatic test registration that comes along with test plug-in.
Packit 8c9aa0
You probably don't want to use them unless you really know what you are doing.
Packit 8c9aa0

Packit 8c9aa0

Packit 8c9aa0
Using CppUnit:
Packit 8c9aa0
--------------
Packit 8c9aa0

Packit 8c9aa0
* Writing unit tests:
Packit 8c9aa0
  To write unit tests, you need to link against cppunitXX.lib, where
Packit 8c9aa0
  XX is the chosen configuration suffix letters. 
Packit 8c9aa0
  CppUnit include directory must be in the include search path.
Packit 8c9aa0
  You can do that by adding the include directory in 
Packit 8c9aa0
  Project Settings/C++/Preprocessor/Additional include directories,
Packit 8c9aa0
  or Tools/Options/Directories/Include.
Packit 8c9aa0

Packit 8c9aa0
  Quick steps:
Packit 8c9aa0
  - link lib/cppunitXX.lib
Packit 8c9aa0
  - include/ must be in the include search path
Packit 8c9aa0

Packit 8c9aa0
* Using the TestRunner GUI:
Packit 8c9aa0
  To use the test runner GUI you need to link against testrunnerXX.lib
Packit 8c9aa0
  and cppunitXX.lib, where XX is the chosen configuration suffix 
Packit 8c9aa0
  letters. testrunner.dll must be in the path when your program is
Packit 8c9aa0
  run (the Debug/Release directory, your project dsp directory, or
Packit 8c9aa0
  in a directory specified in the PATH environment variable).
Packit 8c9aa0
  One of the easiest way to do that is to either add a post-build
Packit 8c9aa0
  command or add the testrunner.dll which is in the lib/ directory
Packit 8c9aa0
  to your project and define a custom build step that copy the
Packit 8c9aa0
  dll to your "Intermediate" directory (Debug or Release usually).
Packit 8c9aa0

Packit 8c9aa0
  Since the TestRunner GUI is a MFC extension DLL, it can access
Packit 8c9aa0
  the CWinApp of the using application. Settings are stored using 
Packit 8c9aa0
  the application registry key. That means that "most recently used
Packit 8c9aa0
  test" settings are different for each application.
Packit 8c9aa0

Packit 8c9aa0
  Quick steps:
Packit 8c9aa0
  - link lib/cppunitXX.lib and lib/testrunnerXX.lib
Packit 8c9aa0
  - include/ must be in the include search path
Packit 8c9aa0
  - lib/testrunnerXX.dll must be available to run your project