1.6.1 Testing:
Dmalloc
Dmalloc
and
Purify
are used to test our software. These are debugging tools that
are useful for tracking down memory leaks, memory access
violations, and other memory related errors. Detailed information on
these tools can be found on the
Dmalloc
homepage and the
Purify
product page on the
Rational
website.
The Dmalloc library works as a replacement for the system's
standard memory management routines, such as malloc, realloc, calloc,
etc. Assuming dmalloc is correctly installed and configured on your
system, follow the steps shown below to build the software for use
with the dmalloc library.
- Change to the directory you made when you
initialized your repository:
- Before running any other tests with Dmalloc, the system library
needs to be built and installed with Dmalloc linked in.
To do this, execute the following commands:
- Now change to the directory containing the part of the code you
wish to test (for example, class/math/) and execute the
following commands:
- It is also possible to test the entire system at once. To do
this, change to the root directory of your repository and
and execute the following commands.
These commands will run a set of diagnostics and output
memory information on the code in the directory and
subdirectories they are run from. It may be convenient to
redirect the output to a text file by appending ">
output" to the end of the final command, where "output"
is the name of the file you wish
to save the output to. The output will look similar to the
sample output for the make DEBUG="-g -dmalloc" test
command shown above. For more information on Dmalloc, see
the Dmalloc
homepage.
|
|
|