summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-04 16:17:15 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-04 08:41:37 -0700
commit3d5d4c876a9daed80d2e2f471433f7185e250d94 (patch)
tree8306312e1d26bc678ae7b2747bd7c8ece437ba2e /commit.h
parent8bc5d33bd86cd21be975522a54f4fa6e1e646a16 (diff)
t/unit-tests: implement test driver
The test driver in "unit-test.c" is responsible for setting up our unit tests and eventually running them. As such, it is also responsible for parsing the command line arguments. The clar unit testing framework provides function `clar_test()` that parses command line arguments and then executes the tests for us. In theory that would already be sufficient. We have the special requirement to always generate TAP-formatted output though, so we'd have to always pass the "-t" argument to clar. Furthermore, some of the options exposed by clar are ineffective when "-t" is used, but they would still be shown when the user passes the "-h" parameter to have the clar show its usage. Implement our own option handling instead of using the one provided by clar, which gives us greater flexibility in how exactly we set things up. We would ideally not use any "normal" code of ours for this such that the unit testing framework doesn't depend on it working correctly. But it is somewhat dubious whether we really want to reimplement all of the option parsing. So for now, let's be pragmatic and reuse it until we find a good reason in the future why we'd really want to avoid it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions