Unit Testing, Anyone?

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 ...

Get Autotools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.