From: Andreas K. <aku...@sh...> - 2006-01-27 04:32:41
|
Hi ya all. People might have seen the series of large commits I did in the last days and week. This mail is just a heads up of what I did, and why. After a long time of procrastinating on this I finally managed to get the motivation to dive into the Tcllib testsuite as a whole and give it a nice scrubbing. For example, while most of the testsuites for the various modules and packages had the correct code to load the local sources for testing instead of from (external) installation we did still had a number of packages which did it wrong, or only half-right. And those which did it completely right not only had heaps of ugliness coming before the actual set of tests, but the code in question was in essence replicated all over. Half of the work I did was to draw the common parts out of this code and put them into a separate file to be shared by all testsuites. This additionally had the benefit of hiding all the ugly machinery behind commands with (nearly) self-explanatory names. The other half then was just drudgery, replacing all the existing replicated boilerplate with much small prologues using all the shiny new stuff. As an end result the headers of all the .test files should now be much more readable when it comes to declaring the needs of the contained testsuite, be it dependencies on versions of Tcl and tcltest, or the loading of the package under test and whatever other supporting files and packages are needed. It should make the creation of new testsuites for Tcllib easier as well. Now, while I consider the main cleanup of the testsuites to be done there are still places in there which could be better. Namely: - A lot of the testsuites under "struct" declare helper commands, some of them quite large. We should consider to put them into their own file and then declare that as a support. - The testsuites under "math" have similar problems. They are a bit worse as well IMHO, as their helpers are also duplicated across the testsuites. And there seem to be several different implementations of some of them floating around. One helper for example compares two floating point numbers for equality within 4 digits after the decimal point. I know I have seen two different implementations of that, and I believe that there might actually be three. - A number of packages have different implementations as well, pure Tcl vs. one or more accelerators. Only some of them have logic to allow the switching between implementations at runtime. And very few of the testsuites actually test all of the implementations they can can lay their hands on as well. There is opportunity for refactoring and generalization, for both package implementations, and accompanying testsuites. So, even with this cleanup now behind us there are still lots of things we can do to make Tcllib better and more polished. Lets go forward. -- So long, Andreas Kupries <aku...@sh...> <http://www.purl.org/NET/akupries/> Developer @ <http://www.activestate.com/> ------------------------------------------------------------------------------- |