Subject: Re: [RFC PATCH 0/2] add an external testing library for unit tests

From: Junio C Hamano <[email-masked]>
Date: Thu, 27 Apr 2023 11:39:59 -0700

Calvin Wan <[email-masked]> writes:

> ... Unit tests additionally provide stability to the
> codebase and can simplify debugging through isolation. Turning parts of
> Git into libraries[1] gives us the ability to run unit tests on the
> libraries and to write unit tests in C. Writing unit tests in pure C,
> rather than with our current shell/test-tool helper setup, simplifies
> test setup, simplifies passing data around (no shell-isms required), and
> reduces testing runtime by not spawning a separate process for every
> test invocation.

Good goal, except that unit tests are not panacea---our ultimate
obligation is to give a stable behaviour to the end users and
end-to-end testing is still needed.  We would benefit from having
tests at both levels.

> Unit testing in C requires a separate testing harness that we ideally
> would like to be TAP-style and to come with a non-restrictive license.
>
> Fortunately, there already exists a C TAP harness library[2] with an MIT
> license (at least for the files included in this series). 

Yup.  Consistency with our existing test framework would make it easier
to adopt for all of us.  Good goal.