@matheusbsbs / matheus-bagliano / commits / 7187c7bbb8
Fork 0

t4210: skip i18n tests that don't work on FreeBSD

A number of t4210-log-i18n tests added in 4e2443b181 set LC_ALL to a UTF-8 locale (is_IS.UTF-8) but then pass an invalid UTF-8 string to --grep. FreeBSD's regcomp() fails in this case with REG_ILLSEQ, "illegal byte sequence," which git then passes to die(): fatal: command line: '�': illegal byte sequence When these tests were added the commit message stated: | It's possible that this | test breaks the "basic" and "extended" backends on some systems that | are more anal than glibc about the encoding of locale issues with | POSIX functions that I can remember which seems to be the case here. Extend test-lib.sh to add a REGEX_ILLSEQ prereq, set it on FreeBSD, and add !REGEX_ILLSEQ to the two affected tests. Signed-off-by: Ed Maste <emaste@freebsd.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ed Maste committed Nov 27, 2019 at 17:15 UTC 7187c7bbb8184ec52726acdbe0eb2ddc98a4fb7e
2 files changed +9 -3
t/t4210-log-i18n.sh
+2 -2
@@ -70,7 +70,7 @@ do
70 then
71 force_regex=.*
72 fi
73 - test_expect_success !MINGW,GETTEXT_LOCALE,$prereq "-c grep.patternType=$engine log --grep does not find non-reencoded values (latin1 + locale)" "
73 + test_expect_success !MINGW,!REGEX_ILLSEQ,GETTEXT_LOCALE,$prereq "-c grep.patternType=$engine log --grep does not find non-reencoded values (latin1 + locale)" "
74 cat >expect <<-\EOF &&
75 latin1
76 utf8
@@ -84,7 +84,7 @@ do
84 test_must_be_empty actual
85 "
86
87 - test_expect_success !MINGW,GETTEXT_LOCALE,$prereq "-c grep.patternType=$engine log --grep does not die on invalid UTF-8 value (latin1 + locale + invalid needle)" "
87 + test_expect_success !MINGW,!REGEX_ILLSEQ,GETTEXT_LOCALE,$prereq "-c grep.patternType=$engine log --grep does not die on invalid UTF-8 value (latin1 + locale + invalid needle)" "
88 LC_ALL=\"$is_IS_locale\" git -c grep.patternType=$engine log --encoding=ISO-8859-1 --format=%s --grep=\"$force_regex$invalid_e\" >actual &&
89 test_must_be_empty actual
90 "
t/test-lib.sh
+7 -1
@@ -1422,7 +1422,7 @@ else
1422 '
1423 fi
1424
1425 -# Fix some commands on Windows
1425 +# Fix some commands on Windows, and other OS-specific things
1426 uname_s=$(uname -s)
1427 case $uname_s in
1428 *MINGW*)
@@ -1453,6 +1453,12 @@ case $uname_s in
1453 test_set_prereq SED_STRIPS_CR
1454 test_set_prereq GREP_STRIPS_CR
1455 ;;
1456 +FreeBSD)
1457 + test_set_prereq REGEX_ILLSEQ
1458 + test_set_prereq POSIXPERM
1459 + test_set_prereq BSLASHPSPEC
1460 + test_set_prereq EXECKEEPSPID
1461 + ;;
1462 *)
1463 test_set_prereq POSIXPERM
1464 test_set_prereq BSLASHPSPEC