initial load of upstream version 1.06.32
[xmlrpc-c] / doc / TESTING
1 In general, we want to run as many automated test tools on the
2 Xmlrpc-c libraries as possible.  Before releasing a new release,
3 please run as many of these tests as possible.
4
5
6 Included Test Suites
7 --------------------
8
9 The 'test' program tests core functions.  These are functions that
10 don't involve HTTP communications.  So obviously, it doesn't do any
11 end-to-end client/server tests.
12
13 The program is in src/test/test.  You have to build that explicitly (with
14 src/test/ as your current directory, do a 'make'); a top level 'make all'
15 doesn't build it.  (Reason: it's a tricky build, and we don't a user's
16 build to fail just because of this program that a user doesn't need).
17
18 src/cpp/cpptest is similar for the C++ libraries.
19
20 Note: Before Release 1.03, 'test' was called 'rpctest' and both it
21 and 'cpptest' were in the src/ directory and were built by 'make all'.
22
23
24 Memory Leaks
25 ------------
26
27 (Linux only?) Install Owen Taylor's 'memprof' utility. This program
28 includes a malloc debugger and a conservative garbage collector. To run it,
29 type:
30
31   memprof test
32
33 This should report any memory leaks which occur while the test suites are
34 running.
35
36
37 Electric Fence
38 --------------
39
40 (Most Unix platforms.) Install Bruce Perens' Electric Fence library, and
41 read the man pages carefully. Link 'test' against '-lefence', and run it
42 with the following sets of environment variables:
43
44   1) (Default environment.)
45      Test for heap block overruns.
46
47   2) EF_PROTECT_BELOW=1
48      Test for heap block underruns.
49
50   3) EF_PROTECT_FREE=1
51      Test for doubly-freed memory and illegal accesses to freed memory.
52
53   4) EF_ALIGNMENT=0
54      Test for very small block overruns. This is an important test, but
55      it may not work on some platforms. Please see the efence manpage for
56      more information.
57
58 (After each run, unset the environment variables from the previous run.)
59
60 Using a Bourne shell (such as bash) you can run all these tests as follows:
61
62   test
63   EF_PROTECT_BELOW=1 test
64   EF_PROTECT_FREE=1 test
65   EF_ALIGNMENT=0 test
66
67 Alternatively, if you have a copy of Purify installed, please run that.
68
69
70 End-to-End Tests
71 ----------------
72
73 To test Abyss and the client XML transports, use the example
74 programs examples/sample_add_server and examples/sample_add_client:
75
76   $ export XMLRPC_TRACE_XML=1
77   $ examples/sample_add_server 8080&
78   $ examples/sample_add_client
79
80 Note that we use XMLRPC_TRACE_XML so we can see the XML flying by on
81 both sides of the connection.
82
83 Note that the Port 8080 is hardcoded in sample_add_client.
84
85 Note that sample_add_client uses only the default XML transport.
86
87
88 You can do more extensive client testing with the 'xmlrpc' program
89 (tools/xmlrpc/xmlrpc).
90
91
92 Tips
93 ----
94
95 To debug Abyss without threads, don't pass -D_UNIX or -D_WIN32. The server
96 will run in a single-threaded mode.