July 2010
Intermediate to advanced
360 pages
11h 12m
English
Some people insist that unit testing is evil, but the only honest rationale they can come up with for not doing it is laziness. Proper unit testing is hard work, but it pays off in the end. Those who do it have learned a lesson (usually in childhood) about the value of delayed gratification.
A good build system should incorporate proper unit testing. The most commonly used target for testing a build is the check target, so we'll go ahead and add it in the usual manner. The actual unit test should probably go in src/Makefile because that's where the jupiter executable is built, so we'll pass the check target down from the top-level makefile.
But what commands do we put in the check rule? Well, jupiter is a pretty simple program—it ...