On Thu, Jul 26, 2012 at 11:16:45AM -0700, Junio C Hamano wrote:

> Consolidating the logic to set necessary prerequisites used in
> various scripts is very good, but I am not sure adding them to
> test-lib and run them unconditionally is a good idea.  SYMLINKS is
> used by 47 among 595 tests, which is common enough, but the new ones
> are not common enough.  I do not think we want to create a temporary
> "junk" dir, two temporary "camelcase" files, read and compare them,
> when nobody in the script cares.
> We do not have to split them into separate include files, though, in
> order to avoid such waste.  Instead, you can make the logic to set
> prerequisite conditional inside test-lib.sh and update the users.
> Something like:
> [...]
>       (at the beginning of t/t0003-attributes.sh)
>       #!/bin/sh
>         test_description=gitattributes
>       . ./test-lib.sh

That looks like a maintenance annoyance. Can't we just have the
prerequisite-checker lazily perform the test on demand and cache the
result?  It should be OK as long as:

  1. The prereq is careful about its pre- and post- conditions. We
     already make sure to clean up after those tests so as not to taint
     later tests. We would probably want to also make them more careful
     about preconditions like which directory they are in (so, for
     example, refer to "$TRASH_DIRECTORY/junk" and not "junk").

  2. The prereq test does not accidentally munge any existing test
     state from previous tests. That should not be a big deal as long as
     we avoid names like "junk" in favor of more unique names like

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to