Re: [dev] Suckless unit testing in C?

From: Anselm R Garbe <garbeam_AT_gmail.com>
Date: Wed, 25 Feb 2015 07:45:58 +0100

On 24 February 2015 at 22:21, Sam Dodrill <shadow.h511_AT_gmail.com> wrote:
> I was wondering what you all use for a suckless style unit testing
> framework in C.

If you apply the Unix principle correctly, main() is your unit test.

All you need is creating test input, save the test output and whenever
you call main() with the same test input, you just check for
regressions in the test output compared to the expected test output.

If you need unit tests to test portions of your code, you've probably
not followed the Unix principle well.

Requiring unit tests as in Java, C++, etc. is typically a very good
indicator that your overall software architecture sucks and that it's
incompliant with the Unix principle.

-Anselm
Received on Wed Feb 25 2015 - 07:45:58 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 25 2015 - 07:48:07 CET