mbox series

[GSoC,v2,0/4] t: port reftable/readwrite_test.c to the unit testing framework

Message ID 20240809111312.4401-1-chandrapratap3519@gmail.com (mailing list archive)
Headers show
Series t: port reftable/readwrite_test.c to the unit testing framework | expand

Message

Chandra Pratap Aug. 9, 2024, 11:05 a.m. UTC
The reftable library comes with self tests, which are exercised
as part of the usual end-to-end tests and are designed to
observe the end-user visible effects of Git commands. What it
exercises, however, is a better match for the unit-testing
framework, merged at 8bf6fbd0 (Merge branch 'js/doc-unit-tests',
2023-12-09), which is designed to observe how low level
implementation details, at the level of sequences of individual
function calls, behave.

Hence, port reftable/readwrite_test.c to the unit testing framework
and improve upon the ported test. The first patch in the series moves
the test to the unit testing framework, and the rest of the patches
improve upon the ported test.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>

---
Changes in v2:
- Drop the fifth patch (t-reftable-readwrite: add tests for print
  functions) of the previous series

CI/PR: https://github.com/gitgitgadget/git/pull/1770

Chandra Pratap(4):
t: move reftable/readwrite_test.c to the unit testing framework
t-reftable-readwrite: use free_names() instead of a for loop
t-reftable-readwrite: use 'for' in place of infinite 'while' loops
t-reftable-readwrite: add test for known error

Makefile                                                         |   2 +-
reftable/reftable-tests.h                                        |   1 -
t/helper/test-reftable.c                                         |   1 -
reftable/readwrite_test.c => t/unit-tests/t-reftable-readwrite.c | 440 +++++++++++++++++++++++-----------------
4 files changed, 218 insertions(+), 226 deletions(-)

Range-diff against v1:

1:  e4b01cd856 < -:  ---------- t-reftable-readwrite: add tests for print functions