]> git.ipfire.org Git - thirdparty/git.git/commit
tests: replace test_tristate with "git env--helper"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 21 Jun 2019 10:18:11 +0000 (12:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Jun 2019 16:42:49 +0000 (09:42 -0700)
commit3b072c577ba594a9fb4ae9426409f1caadafcb08
tree6ff512ada7cb7cb8e35fbde63be0b7170a9ef66c
parent423b05e102711f2875d47c92b3bf613fda8fe226
tests: replace test_tristate with "git env--helper"

The test_tristate helper introduced in 83d842dc8c ("tests: turn on
network daemon tests by default", 2014-02-10) can now be better
implemented with "git env--helper" to give the variables in question
the standard boolean behavior.

The reason for the "tristate" was to have all of false/true/auto,
where "auto" meant either "false" or "true" depending on what the
fallback was. With the --default option to "git env--helper" we can
simply have e.g. GIT_TEST_HTTPD where we know if it's true because the
user asked explicitly ("true"), or true implicitly ("auto").

This breaks backwards compatibility for explicitly setting "auto" for
these variables, but I don't think anyone cares. That was always
intended to be internal.

This means the test_normalize_bool() code in test-lib-functions.sh
goes away in addition to test_tristate(). We still need the
test_skip_or_die() helper, but now it takes the variable name instead
of the value, and uses "git env--bool" to distinguish a default "true"
from an explicit "true" (in those "explicit true" cases we want to
fail the test in question).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-git-daemon.sh
t/lib-git-svn.sh
t/lib-httpd.sh
t/t5512-ls-remote.sh
t/test-lib-functions.sh