]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4210: skip i18n tests that don't work on FreeBSD
authorEd Maste <emaste@freebsd.org>
Wed, 27 Nov 2019 17:15:07 +0000 (17:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 30 Nov 2019 21:51:49 +0000 (13:51 -0800)
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>
t/t4210-log-i18n.sh
t/test-lib.sh

index 6e61f57f09fbcd5684f76d3c81b0f5b626b21c16..c3792081e627ffd10676b0a2a449bdc4df73a7f8 100755 (executable)
@@ -70,7 +70,7 @@ do
        then
            force_regex=.*
        fi
-       test_expect_success !MINGW,GETTEXT_LOCALE,$prereq "-c grep.patternType=$engine log --grep does not find non-reencoded values (latin1 + locale)" "
+       test_expect_success !MINGW,!REGEX_ILLSEQ,GETTEXT_LOCALE,$prereq "-c grep.patternType=$engine log --grep does not find non-reencoded values (latin1 + locale)" "
                cat >expect <<-\EOF &&
                latin1
                utf8
@@ -84,7 +84,7 @@ do
                test_must_be_empty actual
        "
 
-       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)" "
+       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)" "
                LC_ALL=\"$is_IS_locale\" git -c grep.patternType=$engine log --encoding=ISO-8859-1 --format=%s --grep=\"$force_regex$invalid_e\" >actual &&
                test_must_be_empty actual
        "
index 46c44408432ed93dbb2126def0fa05b4159e0548..3b2b8795fd2834b33f93eea401a1831023bfb49f 100644 (file)
@@ -1422,7 +1422,7 @@ else
        '
 fi
 
-# Fix some commands on Windows
+# Fix some commands on Windows, and other OS-specific things
 uname_s=$(uname -s)
 case $uname_s in
 *MINGW*)
@@ -1453,6 +1453,12 @@ case $uname_s in
        test_set_prereq SED_STRIPS_CR
        test_set_prereq GREP_STRIPS_CR
        ;;
+FreeBSD)
+       test_set_prereq REGEX_ILLSEQ
+       test_set_prereq POSIXPERM
+       test_set_prereq BSLASHPSPEC
+       test_set_prereq EXECKEEPSPID
+       ;;
 *)
        test_set_prereq POSIXPERM
        test_set_prereq BSLASHPSPEC