Use cppunit
Compile unit test
Compile the unit test. You need to connect cppunitxx. Lib. XX selects the suffix and letters based on the configuration. The paths included in cppunit must be included in the include search path. You can add
Project Settings/C ++/Preprocessor/Additional include directories or tools/options/directories/include.
Quick Steps:
-Connect to LIB/cpunitxx. Lib
-Inlucde/must be included in the include search path
Use testrunner Gui:
Use the test runner GUI to connect testrunnerxx. lib and cppunitxx. Lib. Here XX is the configuration suffix. Testrunner. dll must be inProgramPath to be executed (debug/release directory, path specified in the project DSP path or PATH environment variable ). Simply add the post-build command or run the testrunner command. add the DLL to the LIB/directory of the project and define the general creation steps. Copy the DLL to the "intermediate" Directory (usually debug or release ).
When the testrunner GUI is an MFC extension DLL, you can use the program's cwinapp to enter. Set the keys stored in the registry of the program.
This means that the recently used test settings are different for each application.
Quick Steps:
-Connect lib/cppunitxx. lib and LIB/testrunnerxx. Lib
-Include/must be in the search path
-Lib/testrunnerxx. dll must be available to the project
Use dsplugin:
You must first register the plug-in VC ++, In the tools/customize/add-ins and macro files, select Browse and selecting
LIB/testrunnerdsplugin. dll (must be registered in release or debug ). After the VC ++ instance is running, if a failure occurs, double-click the failed part, and VC ++ opens the file to the failed line.
Use test plug in Runner:
Dll must export the function implementation interface, which is defined in include/msvc6/testrunner/testplugininterface. h.
View examples/msvc6/testplugin/testplugininterfaceimpl. Warning: the runner is still in the experiment.
But not more tests.
If you create a batchjob and run testpluginrunnered.exe, select examples/cppunittest/debugplugin/cppunittestplugind. dll or examples/simple/debugplugin/simple_plugind.dll to test the output.