This is the test suite directory for my source version management system.
SVMS has a test suite. This rather unual for a piece of software that is likely to be only used by one person (me) in the near future. The reason why SVMS has a test suite is because I have become a big fan of writing test cases for a software feature before before I write the code that implements the feature. The result of this strategy is that I wind up with some excellent test cases for no real extra effort on my part. As the project evolves, I am slowly but surely constructing a fairly conprehensive test suite for it that tests most of the nooks and crannys in the code. Also, when I accidently break some feature that has been previously implemented and debugged, I discover the breakage rather quickly. In general, I find that it is much easier to fix the accidental breakage immediately while the code is fresh in my brain than some arbitrary time in the future when I discover the accidental breakage. All-in-all, I find the strategy of codeveloping a test suite with the code to be more productive in the long run.
Currently, all of the SVMS test cases are all kept
in one big recursive
Makefile
. (While this will probably
change sometime in the future, it is good enough for
now.) Each test case has a `golden file' output file
with a suffix of .ok
that specifies the
correct results of the test. The Makfile actually
runs each test case through a filter that converts
some fragile patterns (like timestamps) into constants so
that the golden files can be compared with a simple call
to cmp
. Like most Makefile
's,
the some portions of the Makefile
are not
all that easy to read.
The `golden files' are available.