tests: cache glibc version check
commita6a58f78015fd7f18e887a5e9682223a5b6408c8
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Thu, 4 Aug 2022 13:38:25 +0000 (4 13:38 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Aug 2022 18:09:18 +0000 (4 11:09 -0700)
tree1da14e346e2c5f5d508ddf827a58edc2a1f0396d
parent00d12607a27e387ad78b5957afa05e89c87e83a5
tests: cache glibc version check

131b94a10a ("test-lib.sh: Use GLIBC_TUNABLES instead of MALLOC_CHECK_
on glibc >= 2.34", 2022-03-04) introduced a check for the version of
glibc that is in use. This check is performed as part of
setup_malloc_check() which is called at least once for each test. As
the test involves forking `getconf` and `expr` cache the result and
use that within setup_malloc_check() to avoid forking these extra
processes for each test.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh