t/helper/test_have_prereq.sh: make test_have_prereq available
commit202162f4525505d5838fd140f602aa8156ac8da5
authorKyle J. McKay <mackyle@gmail.com>
Tue, 24 Aug 2021 20:07:35 +0000 (24 13:07 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 24 Aug 2021 20:07:35 +0000 (24 13:07 -0700)
treeef9fccde5bf747cdb4e5a96c615d0abc2e86fa6c
parent6aa8f8ecfb964134e2186ec59eec8aa171123da8
t/helper/test_have_prereq.sh: make test_have_prereq available

In order to correctly decide whether or not the Git sha256 support
can be tested, the only really correct and accurate way to do so
is to test the GITSHA256 prerequisite via the
`test_have_prereq GITSHA256` from the test suite itself.

Using any other technique invites a wrong answer.

Expose the test_have_prereq test suite function externally via
a new helper named, surprisingly, test_have_prereq.

Set it up in such a way that multiple (e.g. parallel make) copies
can run simultaneously without disrupting each other or any
tests that may be running simultaneously.

All the arguments are simply passed through to the test_have_prereq
function and its return status is the exit status of the helper.

One gotcha being that the `bin-wrappers/tg` file needs to already
exist and, to get an accurate answer, the t/TG-TEST-SETTINGS file
also needs to exist or else a nice warning will be dumped out:

    warning: no TG-TEST-SETTINGS file found (run `make settings`)

Both preconditions are, however, easily handled.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
t/helper/.gitignore
t/helper/test_have_prereq.sh [new file with mode: 0644]