git/Documentation/technical
Patrick Steinhardt 9b7caa2809 t: import the clar unit testing framework
Our unit testing framework is a homegrown solution. While it supports
most of our needs, it is likely that the volume of unit tests will grow
quite a bit in the future such that we can exercise low-level subsystems
directly. This surfaces several shortcomings that the current solution
has:

  - There is no way to run only one specific tests. While some of our
    unit tests wire this up manually, others don't. In general, it
    requires quite a bit of boilerplate to get this set up correctly.

  - Failures do not cause a test to stop execution directly. Instead,
    the test author needs to return manually whenever an assertion
    fails. This is rather verbose and is not done correctly in most of
    our unit tests.

  - Wiring up a new testcase requires both implementing the test
    function and calling it in the respective test suite's main
    function, which is creating code duplication.

We can of course fix all of these issues ourselves, but that feels
rather pointless when there are already so many unit testing frameworks
out there that have those features.

We line out some requirements for any unit testing framework in
"Documentation/technical/unit-tests.txt". The "clar" unit testing
framework, which isn't listed in that table yet, ticks many of the
boxes:

  - It is licensed under ISC, which is compatible.

  - It is easily vendorable because it is rather tiny at around 1200
    lines of code.

  - It is easily hackable due to the same reason.

  - It has TAP support.

  - It has skippable tests.

  - It preprocesses test files in order to extract test functions, which
    then get wired up automatically.

While it's not perfect, the fact that clar originates from the libgit2
project means that it should be rather easy for us to collaborate with
upstream to plug any gaps.

Import the clar unit testing framework at commit 1516124 (Merge pull
request #97 from pks-t/pks-whitespace-fixes, 2024-08-15). The framework
will be wired up in subsequent commits.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-04 08:41:36 -07:00
..
.gitignore
api-error-handling.txt api docs: link to html version of api-trace2 2022-09-16 08:39:11 -07:00
api-index-skel.txt documentation: fix singular vs. plural 2023-10-09 12:06:29 -07:00
api-index.sh
api-merge.txt merge-ll: rename from ll-merge 2023-06-21 13:39:54 -07:00
api-parse-options.txt Documentation: clean up various typos in technical docs 2022-09-21 10:28:36 -07:00
api-simple-ipc.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
api-trace2.txt trace2: add global counter mechanism 2022-10-24 12:45:26 -07:00
bitmap-format.txt Documentation/technical/bitmap-format.txt: add missing position table 2024-06-14 14:19:26 -07:00
bundle-uri.txt bundle-uri: drop bundle.flag from design doc 2023-01-31 08:57:48 -08:00
commit-graph.txt documentation: fix typos 2023-10-09 12:06:24 -07:00
directory-rename-detection.txt directory-rename-detection.txt: small updates due to merge-ort optimizations 2021-08-05 08:57:39 -07:00
hash-function-transition.txt Documentation: render dash correctly 2023-01-23 09:40:14 -08:00
long-running-process-protocol.txt docs: move protocol-related docs to man section 5 2022-08-04 14:12:23 -07:00
multi-pack-index.txt Documentation: describe incremental MIDX format 2024-08-06 12:01:35 -07:00
pack-heuristics.txt
packfile-uri.txt docs: move protocol-related docs to man section 5 2022-08-04 14:12:23 -07:00
parallel-checkout.txt documentation: add missing quotes 2023-10-09 12:06:47 -07:00
partial-clone.txt documentation: add missing article 2023-10-09 12:06:29 -07:00
platform-support.txt Documentation: add platform support policy 2024-08-02 16:27:15 -07:00
racy-git.txt documentation: fix singular vs. plural 2023-10-09 12:06:29 -07:00
reftable.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
remembering-renames.txt docs: typofixes 2023-06-12 13:52:51 -07:00
repository-version.txt refs: introduce reftable backend 2024-02-07 08:28:37 -08:00
rerere.txt documentation: remove extraneous words 2023-10-09 12:06:29 -07:00
scalar.txt Documentation/technical: include Scalar technical doc 2022-09-02 10:02:56 -07:00
send-pack-pipeline.txt
shallow.txt shallow.txt: document SHA-256 shallow format 2020-08-17 10:35:13 -07:00
sparse-checkout.txt sparse-checkout.txt: new document with sparse-checkout directions 2022-11-07 18:15:45 -05:00
sparse-index.txt sparse-index: API protection strategy 2021-04-14 13:45:34 -07:00
trivial-merge.txt
unit-tests.txt t: import the clar unit testing framework 2024-09-04 08:41:36 -07:00