Merge branch 'sk/mingw-tests-workaround'
Make tests pass on msysgit by mostly disabling ones that are infeasible on that platform. * sk/mingw-tests-workaround: t800[12]: work around MSys limitation t9902: mingw-specific fix for gitfile link files t4210: skip command-line encoding tests on mingw MinGW: disable legacy encoding tests t0110/MinGW: skip tests that pass arbitrary bytes on the command line MinGW: Skip test redirecting to fd 4
This commit is contained in:
commit
c372e7b01b
@ -1,6 +1,17 @@
|
||||
# This file isn't used as a test script directly, instead it is
|
||||
# sourced from t8001-annotate.sh and t8002-blame.sh.
|
||||
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
sanitize_L () {
|
||||
echo "$1" | sed 'sX\(^-L\|,\)\^\?/X&\\;*Xg'
|
||||
}
|
||||
else
|
||||
sanitize_L () {
|
||||
echo "$1"
|
||||
}
|
||||
fi
|
||||
|
||||
check_count () {
|
||||
head= &&
|
||||
file='file' &&
|
||||
@ -10,6 +21,7 @@ check_count () {
|
||||
case "$1" in
|
||||
-h) head="$2"; shift; shift ;;
|
||||
-f) file="$2"; shift; shift ;;
|
||||
-L*) options="$options $(sanitize_L "$1")"; shift ;;
|
||||
-*) options="$options $1"; shift ;;
|
||||
*) break ;;
|
||||
esac
|
||||
|
@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'read from file descriptor' '
|
||||
test_expect_success NOT_MINGW 'read from file descriptor' '
|
||||
rm -f input &&
|
||||
echo hello >expect &&
|
||||
echo hello >input &&
|
||||
|
@ -117,7 +117,7 @@ test_expect_success 'url general escapes' '
|
||||
test "$(test-urlmatch-normalization -p "X://W?'\!'")" = "x://w/?'\!'"
|
||||
'
|
||||
|
||||
test_expect_success 'url high-bit escapes' '
|
||||
test_expect_success !MINGW 'url high-bit escapes' '
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-1")")" = "x://q/%01%02%03%04%05%06%07%08%0E%0F%10%11%12" &&
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-2")")" = "x://q/%13%14%15%16%17%18%19%1B%1C%1D%1E%1F%7F" &&
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-3")")" = "x://q/%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F" &&
|
||||
@ -127,7 +127,10 @@ test_expect_success 'url high-bit escapes' '
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-7")")" = "x://q/%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF" &&
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-8")")" = "x://q/%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF" &&
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-9")")" = "x://q/%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF" &&
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-10")")" = "x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF" &&
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-10")")" = "x://q/%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF"
|
||||
'
|
||||
|
||||
test_expect_success 'url utf-8 escapes' '
|
||||
test "$(test-urlmatch-normalization -p "$(cat "$tu-11")")" = "x://q/%C2%80%DF%BF%E0%A0%80%EF%BF%BD%F0%90%80%80%F0%AF%BF%BD"
|
||||
'
|
||||
|
||||
|
@ -54,10 +54,13 @@ test_expect_success setup '
|
||||
git add yours &&
|
||||
git commit -s -m "Second on side" &&
|
||||
|
||||
# the second one on the side branch is ISO-8859-1
|
||||
git config i18n.commitencoding ISO8859-1 &&
|
||||
# use author and committer name in ISO-8859-1 to match it.
|
||||
. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
|
||||
if test_have_prereq NOT_MINGW
|
||||
then
|
||||
# the second one on the side branch is ISO-8859-1
|
||||
git config i18n.commitencoding ISO8859-1 &&
|
||||
# use author and committer name in ISO-8859-1 to match it.
|
||||
. "$TEST_DIRECTORY"/t3901-8859-1.txt
|
||||
fi &&
|
||||
test_tick &&
|
||||
echo Yet another >theirs &&
|
||||
git add theirs &&
|
||||
@ -119,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
|
||||
check_encoding 2
|
||||
'
|
||||
|
||||
test_expect_success 'rebase (L/L)' '
|
||||
test_expect_success NOT_MINGW 'rebase (L/L)' '
|
||||
# In this test we want ISO-8859-1 encoded commits as the result
|
||||
git config i18n.commitencoding ISO8859-1 &&
|
||||
git config i18n.logoutputencoding ISO8859-1 &&
|
||||
@ -131,7 +134,7 @@ test_expect_success 'rebase (L/L)' '
|
||||
check_encoding 2 8859
|
||||
'
|
||||
|
||||
test_expect_success 'rebase (L/U)' '
|
||||
test_expect_success NOT_MINGW 'rebase (L/U)' '
|
||||
# This is pathological -- use UTF-8 as intermediate form
|
||||
# to get ISO-8859-1 results.
|
||||
git config i18n.commitencoding ISO8859-1 &&
|
||||
@ -159,7 +162,7 @@ test_expect_success 'cherry-pick(U/U)' '
|
||||
check_encoding 3
|
||||
'
|
||||
|
||||
test_expect_success 'cherry-pick(L/L)' '
|
||||
test_expect_success NOT_MINGW 'cherry-pick(L/L)' '
|
||||
# Both the commitencoding and logoutputencoding is set to ISO-8859-1
|
||||
|
||||
git config i18n.commitencoding ISO8859-1 &&
|
||||
@ -189,7 +192,7 @@ test_expect_success 'cherry-pick(U/L)' '
|
||||
check_encoding 3
|
||||
'
|
||||
|
||||
test_expect_success 'cherry-pick(L/U)' '
|
||||
test_expect_success NOT_MINGW 'cherry-pick(L/U)' '
|
||||
# Again, the commitencoding is set to ISO-8859-1 but
|
||||
# logoutputencoding is set to UTF-8.
|
||||
|
||||
|
@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
|
||||
test_cmp expect log.predictable
|
||||
'
|
||||
|
||||
test_expect_success 'shortlog wrapping' '
|
||||
test_expect_success NOT_MINGW 'shortlog wrapping' '
|
||||
cat >expect <<\EOF &&
|
||||
A U Thor (5):
|
||||
Test
|
||||
@ -114,7 +114,7 @@ EOF
|
||||
test_cmp expect out
|
||||
'
|
||||
|
||||
test_expect_success 'shortlog from non-git directory' '
|
||||
test_expect_success NOT_MINGW 'shortlog from non-git directory' '
|
||||
git log HEAD >log &&
|
||||
GIT_DIR=non-existing git shortlog -w <log >out &&
|
||||
test_cmp expect out
|
||||
@ -159,7 +159,7 @@ $DSCHO (2):
|
||||
|
||||
EOF
|
||||
|
||||
test_expect_success 'shortlog encoding' '
|
||||
test_expect_success NOT_MINGW 'shortlog encoding' '
|
||||
git reset --hard "$commit" &&
|
||||
git config --unset i18n.commitencoding &&
|
||||
echo 2 > a1 &&
|
||||
|
@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'log --grep searches in log output encoding (latin1)' '
|
||||
test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' '
|
||||
cat >expect <<-\EOF &&
|
||||
latin1
|
||||
utf8
|
||||
@ -43,7 +43,7 @@ test_expect_success 'log --grep searches in log output encoding (latin1)' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'log --grep does not find non-reencoded values (utf8)' '
|
||||
test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' '
|
||||
>expect &&
|
||||
git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
|
||||
test_cmp expect actual
|
||||
|
@ -33,7 +33,7 @@ author $SJIS_NAME
|
||||
summary $SJIS_MSG
|
||||
EOF
|
||||
|
||||
test_expect_success \
|
||||
test_expect_success NOT_MINGW \
|
||||
'blame respects i18n.commitencoding' '
|
||||
git blame --incremental file | \
|
||||
egrep "^(author|summary) " > actual &&
|
||||
@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME
|
||||
summary $EUC_JAPAN_MSG
|
||||
EOF
|
||||
|
||||
test_expect_success \
|
||||
test_expect_success NOT_MINGW \
|
||||
'blame respects i18n.logoutputencoding' '
|
||||
git config i18n.logoutputencoding eucJP &&
|
||||
git blame --incremental file | \
|
||||
@ -66,7 +66,7 @@ author $UTF8_NAME
|
||||
summary $UTF8_MSG
|
||||
EOF
|
||||
|
||||
test_expect_success \
|
||||
test_expect_success NOT_MINGW \
|
||||
'blame respects --encoding=UTF-8' '
|
||||
git blame --incremental --encoding=UTF-8 file | \
|
||||
egrep "^(author|summary) " > actual &&
|
||||
@ -82,7 +82,7 @@ author $UTF8_NAME
|
||||
summary $UTF8_MSG
|
||||
EOF
|
||||
|
||||
test_expect_success \
|
||||
test_expect_success NOT_MINGW \
|
||||
'blame respects --encoding=none' '
|
||||
git blame --incremental --encoding=none file | \
|
||||
egrep "^(author|summary) " > actual &&
|
||||
|
@ -212,9 +212,18 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' '
|
||||
)
|
||||
'
|
||||
|
||||
function pwd_P_W () {
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
pwd -W
|
||||
else
|
||||
pwd -P
|
||||
fi
|
||||
}
|
||||
|
||||
test_expect_success '__gitdir - gitfile in cwd' '
|
||||
echo "$(pwd -P)/otherrepo/.git" >expected &&
|
||||
echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
|
||||
echo "$(pwd_P_W)/otherrepo/.git" >expected &&
|
||||
echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
|
||||
test_when_finished "rm -f subdir/.git" &&
|
||||
(
|
||||
cd subdir &&
|
||||
@ -224,8 +233,8 @@ test_expect_success '__gitdir - gitfile in cwd' '
|
||||
'
|
||||
|
||||
test_expect_success '__gitdir - gitfile in parent' '
|
||||
echo "$(pwd -P)/otherrepo/.git" >expected &&
|
||||
echo "gitdir: $TRASH_DIRECTORY/otherrepo/.git" >subdir/.git &&
|
||||
echo "$(pwd_P_W)/otherrepo/.git" >expected &&
|
||||
echo "gitdir: $(pwd_P_W)/otherrepo/.git" >subdir/.git &&
|
||||
test_when_finished "rm -f subdir/.git" &&
|
||||
(
|
||||
cd subdir/subsubdir &&
|
||||
|
Loading…
Reference in New Issue
Block a user