[Pntool-developers] SF.net SVN: pntool:[217] spnbox
Brought to you by:
compaqdrew,
miordache
From: <Ste...@us...> - 2009-08-14 22:27:55
|
Revision: 217 http://pntool.svn.sourceforge.net/pntool/?rev=217&view=rev Author: StephenCamp Date: 2009-08-14 22:27:49 +0000 (Fri, 14 Aug 2009) Log Message: ----------- Modified the makefile: the memwatch test routines can now be included or excluded by setting a single variable in the makefile. Updated the readme to describe the new makefile usage. Modified Paths: -------------- spnbox/README.txt spnbox/tests/Makefile Modified: spnbox/README.txt =================================================================== --- spnbox/README.txt 2009-08-14 21:47:00 UTC (rev 216) +++ spnbox/README.txt 2009-08-14 22:27:49 UTC (rev 217) @@ -11,14 +11,14 @@ The makefile within the directory will make any of the test programs. To generate the test program for a particular function, use a command of the form: make <functionname> This will generate an executable called <functionname>.exe. +Note that the makefile can be configured to include a set of debugging routines from the third-party library memwatch that will aid in debugging memory errors. See MEMORY DEBUGGING later in this file for more information. To include this library, the "USEMEMWATCH" variable in the test makefile should be set to "yes". If it is set to anything else the memory debugging routines will not be included. make all will generate test executables for all spnbox functions. To test the various functions in the matrixmath.c file, use make matrixmath. To test the functions in the extendedmatrix.c file, use make extendedmatrix. -The test makefile includes in each source file it compiles the header files and definitions needed to use the memory debugging routines in the memwatch third-party library. (see pntool/third-party/memwatch-2.71). It also compiles and links the file memwatch.c from the library in all test executables. For all with such test programs except that ipslv, the test program is implemented as a program that will read from an input stream containing text in a human-readable format, interpret the text as parameters to the function, make a function call, and display the results. For format specifications, see the comments in StructuredIO.c/h. The programs may be invoked with a single command line argument, which will be taken as the name of a text file from which to read the input. If no command line argument is used the test programs will take input from the console. -Pre-formatted test scripts with problems to test each part of a function have been provided. These are named in the form test-<functionname>.txt. +Pre-formatted test scripts with problems to test each part of a function have been provided. These are named in the form test-<functionname>.txt. There is no test script for admcon.c as the admcon function is thoroughly tested by its use within the dp function. Thus, to test ipsolve with the default test script the following command sequence might be issued: @@ -26,6 +26,14 @@ make ipsolve ./ipsolve test-ipsolve.txt +#MEMORY DEBUGGING +The test makefile can compile and link the spnbox files so that their test routines will make use of the "memwatch" memory debugger. Memwatch is a set of routines, declared in memwatch.h in the pntool/third-party/memwatch-2.71/ directory, that overrides the standard memory allocation and deallocation functions with its own wrappers. +Memwatch keeps track of allocations and deallocations through its routines. It can detect some but not all array overwrites, underwrites, wild pointer writes, deallocations of invalid pointers, and various other potential errors related to dynamically allocated memory. +When a program that contains the Memwatch routines runs it will create a text file in the current directory, titled memwatch.log by default, that lists any errors or anomalies detected by the memwatch routines. +Note that the memwatch routines slow memory-related operations drastically. +See pntool/third-party/memwatch-2.71/USING for more information. +memwatch is licensed under the GNU public license, present in the file pntool/third-party/memwatch-2.71/gpl.txt. + #FILES Main directory: - spnbox.h: This is the header file containing the definitions for all the SPNBOX @@ -59,5 +67,4 @@ - Makefile: This is the test makefile. It is responsible for building various test routines and takes targets as described above in #TESTING. - All other files are the source files for the test executables for various - functions. - + functions or the test scripts intended to be used with various text executables. Modified: spnbox/tests/Makefile =================================================================== --- spnbox/tests/Makefile 2009-08-14 21:47:00 UTC (rev 216) +++ spnbox/tests/Makefile 2009-08-14 22:27:49 UTC (rev 217) @@ -4,14 +4,27 @@ #clean cleans the test routine executables and intermediate files. #<functionname> is the name of an spnbox function. This builds the test routines for that function. -#To remove the memwatch memory debugging routines: -#Make MEMWCOMP equal to COMPILER (removing the include and define options) -#Remove "memwatch.o" from the list of COMMON dependencies. +#This variable controls whether or not the memwatch memory debugging routines are included in +#compilation. Set to "yes" to include them and "no" to leave them out. +USEMEMWATCH = no +#Assign the default compiler call and options. COMPILER=gcc -g + +#Assign the compiler call that will affect the inclusion or exclusion of the memwatch routines. +ifeq ($(USEMEMWATCH),yes) MEMWCOMP=$(COMPILER) -include string.h -include ../../third-party/memwatch-2.71/memwatch.h -DMEMWATCH -DMEMWATCH_STDIO -#The dependencies common to all test executables. +else +MEMWCOMP=$(COMPILER) +endif + +#The dependencies common to all test executables. Include memwatch.o only if the memwatch routines should +# be included. +ifeq ($(USEMEMWATCH),yes) COMMON=StructuredIO.o test.o MemoryManager.o general.o pns.o matrix.o matrixmath.o deallocation.o memwatch.o +else +COMMON=StructuredIO.o test.o MemoryManager.o general.o pns.o matrix.o matrixmath.o deallocation.o +endif #These symbols define the dependencies of various test executables. AVPR=avpr.o This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |