TESTING 2.7 KB

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