From: Patrick Steinhardt <ps@pks.im>
To: Josh Steadmon <steadmon@google.com>,
Chandra Pratap <chandrapratap3519@gmail.com>,
git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v3 1/4] t: move reftable/readwrite_test.c to the unit testing framework
Date: Wed, 14 Aug 2024 15:08:38 +0200 [thread overview]
Message-ID: <ZrysVg04x_uIdNio@tanuki> (raw)
In-Reply-To: <2rxxfpzijfmvo65xournnmx4oawzqlhgipje4cxzxvo5aqzt6u@xppoikj262cp>
On Tue, Aug 13, 2024 at 03:33:04PM -0700, Josh Steadmon wrote:
> On 2024.08.13 20:04, Chandra Pratap wrote:
> > reftable/readwrite_test.c exercises the functions defined in
> > reftable/reader.{c,h} and reftable/writer.{c,h}. Migrate
> > reftable/readwrite_test.c to the unit testing framework. Migration
> > involves refactoring the tests to use the unit testing framework
> > instead of reftable's test framework and renaming the tests to
> > align with unit-tests' naming conventions.
> >
> > Since some tests in reftable/readwrite_test.c use the functions
> > set_test_hash(), noop_flush() and strbuf_add_void() defined in
> > reftable/test_framework.{c,h} but these files are not #included
> > in the ported unit test, copy these functions in the new test file.
>
> I'm assuming that eventually, reftable/test_framework (and all the rest
> of reftable/libreftable_test.a) will be removed after all the tests are
> converted to the unit test framework, is that correct? Will other tests
> need these test_framework functions? If so, I'd rather not end up with
> duplicates in each test file, even if these are small functions. Is
> there a reason why we can't link the reftable/test_framework object (or
> the whole reftable/libreftable_test.a library)?
The reason is likely that they use different infra, e.g. `EXPECT()` vs
`check()`. So instead of linking `libreftable_test.a`, I think it is
fine to duplicate the functionality in `t/unit-tests`. In not too
distant of a future we're going to get rid of everything in the reftable
tests anyway, including the `libreftable_test.a` library. So avoiding
the duplication doesn't make a ton of sense to me.
That being said, I think we should not duplicate functionality in
`t/unit-tests`. So if there is functionality used by multiple tests, we
should likely move it into a new `t/unit-tests/lib-reftable.c` file.
Patrick
next prev parent reply other threads:[~2024-08-14 13:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 14:11 [GSoC][PATCH 0/5] t: port reftable/readwrite_test.c to the unit testing framework Chandra Pratap
2024-08-07 14:11 ` [PATCH 1/5] t: move " Chandra Pratap
2024-08-07 14:11 ` [PATCH 2/5] t-reftable-readwrite: use free_names() instead of a for loop Chandra Pratap
2024-08-07 14:11 ` [PATCH 3/5] t-reftable-readwrite: use 'for' in place of infinite 'while' loops Chandra Pratap
2024-08-07 14:12 ` [PATCH 4/5] t-reftable-readwrite: add test for known error Chandra Pratap
2024-08-07 14:12 ` [PATCH 5/5] t-reftable-readwrite: add tests for print functions Chandra Pratap
2024-08-08 8:12 ` Patrick Steinhardt
2024-08-08 12:00 ` Patrick Steinhardt
2024-08-08 14:25 ` Chandra Pratap
2024-08-09 16:56 ` Junio C Hamano
2024-08-09 11:05 ` [GSoC][PATCH v2 0/4] t: port reftable/readwrite_test.c to the unit testing framework Chandra Pratap
2024-08-09 11:05 ` [PATCH v2 1/4] t: move " Chandra Pratap
2024-08-09 18:12 ` Junio C Hamano
2024-08-12 14:50 ` Chandra Pratap
2024-08-09 11:05 ` [PATCH v2 2/4] t-reftable-readwrite: use free_names() instead of a for loop Chandra Pratap
2024-08-09 18:57 ` Junio C Hamano
2024-08-10 5:50 ` Chandra Pratap
2024-08-10 6:10 ` Junio C Hamano
2024-08-09 11:05 ` [PATCH v2 3/4] t-reftable-readwrite: use 'for' in place of infinite 'while' loops Chandra Pratap
2024-08-09 19:06 ` Junio C Hamano
2024-08-09 11:05 ` [PATCH v2 4/4] t-reftable-readwrite: add test for known error Chandra Pratap
2024-08-13 14:34 ` [GSoC][PATCH v3 0/4] t: port reftable/readwrite_test.c to the unit testing framework Chandra Pratap
2024-08-13 14:34 ` [PATCH v3 1/4] t: move " Chandra Pratap
2024-08-13 22:33 ` Josh Steadmon
2024-08-14 11:48 ` Chandra Pratap
2024-08-14 13:08 ` Patrick Steinhardt [this message]
2024-08-13 14:34 ` [PATCH v3 2/4] t-reftable-readwrite: use free_names() instead of a for loop Chandra Pratap
2024-08-13 14:34 ` [PATCH v3 3/4] t-reftable-readwrite: use 'for' in place of infinite 'while' loops Chandra Pratap
2024-08-13 14:34 ` [PATCH v3 4/4] t-reftable-readwrite: add test for known error Chandra Pratap
2024-08-13 17:10 ` [GSoC][PATCH v3 0/4] t: port reftable/readwrite_test.c to the unit testing framework Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZrysVg04x_uIdNio@tanuki \
--to=ps@pks.im \
--cc=chandrapratap3519@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=steadmon@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.