Re: jn/apply-filename-with-sp (Re: What's cooking in git.git (Aug 2010, #02; Wed, 11))
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Aug 13, 2010, 00:59 UTC
- Message-ID
- <AANLkTimobYCq2fBzF3j2ukCGhMEDVmMBN=7g3rURcqo7@mail.gmail.com>
- In-Reply-To
- <7v1va3pgio.fsf@alter.siamese.dyndns.org>
On Thu, Aug 12, 2010 at 23:17, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> The file based caching of the above wouldn't work well under "make -j"; > without it, we can still have a prerequisite checked only once per a test > script run, which is not worse than the current situation (and it would > even save cycles if a test does not check for a particular prereq, > e.g. SYMLINKS, that is always checked in test-lib).
I think that's being a little too clever for such a small part of the test suite, better to just stick specialized checks like these into e.g. lib-check-fs.sh, which those tests can then source.
Or just leave it as-is, trying to create a few files is a negligible part of the test execution time, most of the tests are doing a lot mork work than just trying to create a symlink or a file with a funny name.
Anyway, a simpler implementation of lazy-loading would be to have e.g. t/lib-prereq/FUNNYNAMES.sh. test_have_prereq could then just do:
lazy="$TEST_DIRECTORY/lib-prereq/$prereq.sh"
test -f $lazy && . $lazy # TODO: Don't load this if we've done it already
case $satisfied in ...Or something like that, that'd eliminate the need for file creation, since prereq labels would map directly to filenames, and there could be an internal "${prereq}_FOO" variable checking if it was loaded already.