]> git.saurik.com Git - wxWidgets.git/blame - docs/tech/tn0017.txt
Updated depricated stuff
[wxWidgets.git] / docs / tech / tn0017.txt
CommitLineData
4f09729d
VZ
1 How to write unit tests for wxWindows
2 =====================================
3
4 Unit tests for wxWindows are written using small cppunit framework. To compile
5(but not to run) them you need to have it installed. Hence the first part of
6this note exlpains how to do it while the second one explains how to write the
7test.
8
9I. CppUnit Installation
10-----------------------
11
121. Get it from http://www.sourceforge.net/projects/cppunit
13 (latest version as of the time of this writing is 1.8.0)
14
152. Build the library:
16 a) Under Windows using VC++ (both versions 6 and 7 work):
17 - build everything in CppUnitLibraries.dsw work space
18 - add include and lib subdirectories of the directory
19 where you installed cppunit to the compiler search path
20 using "Tools|Options" menu in VC IDEA
21
22 b) Under Unix: run configure && make && make install as usual
23
24
25II. Writing tests with CppUnit
26------------------------------
27
281. Create a new directory tests/foo
29
302. Write the main.cpp file for the test program copying, if you want,
31 from one of the existing tests. The things to look for:
32 a) #include "wx/cppunit.h" instead of directly including CppUnit headers
33 b) don't put too many things in one test case nor in one method of a test
34 case as it makes understanding what exactly failed harder later
35
36 Read CppUnit documentation for more.
37
383. Write a bakefile for the new test (again, copy an existing one...)
39
40=== EOF ===
41
42Author: VZ
43Version: $Id$