]> git.ipfire.org Git - thirdparty/git.git/commit
t4210: detect REG_ILLSEQ dynamically and skip affected tests
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Mon, 18 May 2020 18:44:16 +0000 (11:44 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 May 2020 20:03:36 +0000 (13:03 -0700)
commitc4c2a96ec73775b1a4d4d850bb9ae7f50bc6912e
tree0d7881467d6624d2df4e13f6d0ad69c0b4ba9aea
parentaba8187e4d6a1c517e327a1512589e540943e4c9
t4210: detect REG_ILLSEQ dynamically and skip affected tests

7187c7bbb8 (t4210: skip i18n tests that don't work on FreeBSD, 2019-11-27)
adds a REG_ILLSEQ prerequisite, and to do that copies the common branch in
test-lib and expands it to include it in a special case for FreeBSD.

Instead; test for it using a previously added extension to test-tool and
use that, together with a function that identifies when regcomp/regexec
will be called with broken patterns to avoid any test that would otherwise
rely on undefined behaviour.

The description of the first test which wasn't accurate has been corrected,
and the test rearranged for clarity, including a helper function that avoids
overly long lines.

Only the affected engines will have their tests suppressed, also including
"fixed" if the PCRE optimization that uses LIBPCRE2 since b65abcafc7
(grep: use PCRE v2 for optimized fixed-string search, 2019-07-01) is not
available.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4210-log-i18n.sh
t/test-lib.sh