Subject: Re: [GSoC][PATCH] unit-tests: add tests for oidset.h

From: Junio C Hamano <[email-masked]>
Date: Mon, 26 Aug 2024 08:46:25 -0700

Christian Couder <[email-masked]> writes:

>> Add tests for oidset.h library, which were not previously present using
>> the unit testing framework.
>
> It might be interesting to also say if there are tests for oidset in
> the end-to-end tests, not just in the unit test framework. Also I
> think oidset.h is more an API than a library.

Thanks for pointing these out; 100% agreed.

>> This imposes a new restriction of running the test from the 't/' and
>> 't/unit-tests/bin'

I thought we just got rid of such an restriction during the review
of another unit-test topic?  If this is a recurring theme, perhaps
we should teach t/unit-test/test-lib.c a few ways to specify where
the auxiliary files for unit-tests are (e.g. "-d <datadir>" command
line option, or $GIT_UNIT_TEST_DATA_DIR environment variable).

Even though the end-to-end tests do not allow you to start them from
an arbitrary directory (it shouldn't be a rocket science to teach
them to do so, though), they can run in an arbitrary place with the
"--root" option without hindering its ability to read its auxiliary
data files, because they can learn where the t/ directory is by
looking at $TEST_DIRECTORY and a few other variables.  A similar
idea should be applicable to the unit-tests framework.

Thanks.