*
* Build cppunit test on pp platform. 
*


How to write Cppunit test for module
======================================== 
Create cppunit/ sub-directory under module directory (suppose libpp_xyz/). 
Edit Makefile in libpp_xyz/ to add cppunit directory to SUBDIRS. So that your cppunit can be built except release build. 
Copy cppuint template (cppunit/kx2template) to libpp_xyz/cppunit. 
Modify the template by putting test cases on your module. 
Modify Makefile under cppunit/ to have your own test source files, test program name, module library and dependency. 


How to build Cppunit test for module 
========================================
Type .make test. in the cppunit directory to build cppunit test. 
Once build successfully, type .make install. in cppunit directory to build test program and install them into install_root/utest. 


How to run Cppunit test for module 
========================================
The test program must be run on target board. 


Example
======================================== 
fwbase/libpp_diag/ 


Dependency issue when writing test codes
======================================== 
Keep in mind that unit test is for testing your codes mainly, not for testing other module's codes. If module has dependency with other module, there are two ways that you can try to solve this issue. 
If dependency is not complicated, then include the dependences and build. 
If dependency is complicated, write your own implementation of dependences to simulate input and output. Side effect is that test codes can not test interface of dependences. 


If it is hard to simulate input or output, how to test module?
======================================== 
Try to implememt integration test tool. Of course, it will spend more time. But I think it is out of scope of unit test. 


-- YongZou - 17 Jul 2006

