Cppunit unit test usage

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.