Re: [RFC PATCH 0/2] add an external testing library for unit tests
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 27, 2023, 18:39 UTC
- Message-ID
- <xmqqr0s5jhj4.fsf@gitster.g>
- In-Reply-To
- <20230427175007.902278-1-calvinwan@google.com>
Calvin Wan <calvinwan@google.com> writes:
Show 8 quoted lines
> ... 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.
Show 5 quoted lines
> 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.