Re: [GSoC][PATCH] unit-tests: add tests for oidset.h
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 26, 2024, 15:46 UTC
- Message-ID
- <xmqqttf7mgmm.fsf@gitster.g>
- In-Reply-To
- <CAP8UFD2yTMNmx0n1jhOu7dz_4XeOyTy1iLmRWYmuf9QJf75hsQ@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 6 quoted lines
>> 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.