Testing framework for lisp code too



Hi,

I'm attaching a patch to current HEAD which adds support for lisp unit
tests to go with the existing .mac ones.

Basically, the changes are in mload.lisp - after a
;;;;; Test framework definitions ;;;;;
banner.

The interface for putting in lisp unit tests is that

1) You add your .lisp file to the tests directory
2) Add the name of that file (sans .lisp) to $testsuite_lisp_files in
testsuite.lisp
3) Fill your file with calls to test-forms-equal.

For example,

(test-forms-equal
 "bfloatp false"
 nil
 ($bfloatp 1)
 ($bfloatp '$x)
 ($bfloatp #$1/2$)
 ($bfloatp #$0.7$))

(test-forms-equal "this will fail" nil t)

where the string is just a name tag to make it easier to find failures
(failures also get tagged with the test # in the file).

I hope this will be considered suitable for inclusion - it would make
adding tests to the internals a lot less painful than having to sort of
code it all up from maxima code.

Obviously, more tests could be added as well as test-forms-equal - I
couldn't think of anything else immediately, so decided to get this
working to start with.


Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lisp-testing.diff
Type: text/x-patch
Size: 10661 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080126/7c18447d/attachment.bin