test prerequisites: eradicate NOT_FOO

Support for Back when bdccd3c1 (test-lib: allow negation of
prerequisites, 2012-11-14) introduced negated predicates
(e.g. "!MINGW,!CYGWIN"), we already had 5 test files that use
NOT_MINGW (and a few MINGW) as prerequisites.

Let's not add NOT_FOO and rewrite existing ones as !FOO for both
MINGW and CYGWIN.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2014-07-21 15:09:27 -07:00
parent e8d08871c9
commit f57a8715bc
15 changed files with 56 additions and 60 deletions

View File

@ -806,7 +806,7 @@ test_expect_success !MINGW 'quoting allows trailing whitespace' '
test_cmp err.expect err test_cmp err.expect err
' '
test_expect_success NOT_MINGW,NOT_CYGWIN 'correct handling of backslashes' ' test_expect_success !MINGW,!CYGWIN 'correct handling of backslashes' '
rm -rf whitespace && rm -rf whitespace &&
mkdir whitespace && mkdir whitespace &&
>"whitespace/trailing 1 " && >"whitespace/trailing 1 " &&

View File

@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
test_cmp expect actual test_cmp expect actual
' '
test_expect_success NOT_MINGW 'read from file descriptor' ' test_expect_success !MINGW 'read from file descriptor' '
rm -f input && rm -f input &&
echo hello >expect && echo hello >expect &&
echo hello >input && echo hello >input &&

View File

@ -118,7 +118,7 @@ test_expect_success 'alias expansion' '
) )
' '
test_expect_success NOT_MINGW '!alias expansion' ' test_expect_success !MINGW '!alias expansion' '
pwd >expect && pwd >expect &&
( (
git config alias.test-alias-directory !pwd && git config alias.test-alias-directory !pwd &&

View File

@ -824,14 +824,14 @@ cat >expect <<\EOF
trailingtilde = foo~ trailingtilde = foo~
EOF EOF
test_expect_success NOT_MINGW 'set --path' ' test_expect_success !MINGW 'set --path' '
rm -f .git/config && rm -f .git/config &&
git config --path path.home "~/" && git config --path path.home "~/" &&
git config --path path.normal "/dev/null" && git config --path path.normal "/dev/null" &&
git config --path path.trailingtilde "foo~" && git config --path path.trailingtilde "foo~" &&
test_cmp expect .git/config' test_cmp expect .git/config'
if test_have_prereq NOT_MINGW && test "${HOME+set}" if test_have_prereq !MINGW && test "${HOME+set}"
then then
test_set_prereq HOMEVAR test_set_prereq HOMEVAR
fi fi
@ -854,7 +854,7 @@ cat >expect <<\EOF
foo~ foo~
EOF EOF
test_expect_success NOT_MINGW 'get --path copes with unset $HOME' ' test_expect_success !MINGW 'get --path copes with unset $HOME' '
( (
unset HOME; unset HOME;
test_must_fail git config --get --path path.home \ test_must_fail git config --get --path path.home \

View File

@ -7,7 +7,7 @@ test_description='Test git check-ref-format'
valid_ref() { valid_ref() {
prereq= prereq=
case $1 in case $1 in
[A-Z]*) [A-Z!]*)
prereq=$1 prereq=$1
shift shift
esac esac
@ -19,7 +19,7 @@ valid_ref() {
invalid_ref() { invalid_ref() {
prereq= prereq=
case $1 in case $1 in
[A-Z]*) [A-Z!]*)
prereq=$1 prereq=$1
shift shift
esac esac
@ -30,17 +30,17 @@ invalid_ref() {
} }
invalid_ref '' invalid_ref ''
invalid_ref NOT_MINGW '/' invalid_ref !MINGW '/'
invalid_ref NOT_MINGW '/' --allow-onelevel invalid_ref !MINGW '/' --allow-onelevel
invalid_ref NOT_MINGW '/' --normalize invalid_ref !MINGW '/' --normalize
invalid_ref NOT_MINGW '/' '--allow-onelevel --normalize' invalid_ref !MINGW '/' '--allow-onelevel --normalize'
valid_ref 'foo/bar/baz' valid_ref 'foo/bar/baz'
valid_ref 'foo/bar/baz' --normalize valid_ref 'foo/bar/baz' --normalize
invalid_ref 'refs///heads/foo' invalid_ref 'refs///heads/foo'
valid_ref 'refs///heads/foo' --normalize valid_ref 'refs///heads/foo' --normalize
invalid_ref 'heads/foo/' invalid_ref 'heads/foo/'
invalid_ref NOT_MINGW '/heads/foo' invalid_ref !MINGW '/heads/foo'
valid_ref NOT_MINGW '/heads/foo' --normalize valid_ref !MINGW '/heads/foo' --normalize
invalid_ref '///heads/foo' invalid_ref '///heads/foo'
valid_ref '///heads/foo' --normalize valid_ref '///heads/foo' --normalize
invalid_ref './foo' invalid_ref './foo'
@ -120,14 +120,14 @@ invalid_ref "$ref" --refspec-pattern
invalid_ref "$ref" '--refspec-pattern --allow-onelevel' invalid_ref "$ref" '--refspec-pattern --allow-onelevel'
ref='/foo' ref='/foo'
invalid_ref NOT_MINGW "$ref" invalid_ref !MINGW "$ref"
invalid_ref NOT_MINGW "$ref" --allow-onelevel invalid_ref !MINGW "$ref" --allow-onelevel
invalid_ref NOT_MINGW "$ref" --refspec-pattern invalid_ref !MINGW "$ref" --refspec-pattern
invalid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel' invalid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel'
invalid_ref NOT_MINGW "$ref" --normalize invalid_ref !MINGW "$ref" --normalize
valid_ref NOT_MINGW "$ref" '--allow-onelevel --normalize' valid_ref !MINGW "$ref" '--allow-onelevel --normalize'
invalid_ref NOT_MINGW "$ref" '--refspec-pattern --normalize' invalid_ref !MINGW "$ref" '--refspec-pattern --normalize'
valid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize' valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
valid_ref 'refs/heads/a-very-long-refname' valid_ref 'refs/heads/a-very-long-refname'
@ -176,7 +176,7 @@ test_expect_success 'check-ref-format --branch from subdir' '
valid_ref_normalized() { valid_ref_normalized() {
prereq= prereq=
case $1 in case $1 in
[A-Z]*) [A-Z!]*)
prereq=$1 prereq=$1
shift shift
esac esac
@ -188,7 +188,7 @@ valid_ref_normalized() {
invalid_ref_normalized() { invalid_ref_normalized() {
prereq= prereq=
case $1 in case $1 in
[A-Z]*) [A-Z!]*)
prereq=$1 prereq=$1
shift shift
esac esac
@ -199,10 +199,10 @@ invalid_ref_normalized() {
valid_ref_normalized 'heads/foo' 'heads/foo' valid_ref_normalized 'heads/foo' 'heads/foo'
valid_ref_normalized 'refs///heads/foo' 'refs/heads/foo' valid_ref_normalized 'refs///heads/foo' 'refs/heads/foo'
valid_ref_normalized NOT_MINGW '/heads/foo' 'heads/foo' valid_ref_normalized !MINGW '/heads/foo' 'heads/foo'
valid_ref_normalized '///heads/foo' 'heads/foo' valid_ref_normalized '///heads/foo' 'heads/foo'
invalid_ref_normalized 'foo' invalid_ref_normalized 'foo'
invalid_ref_normalized NOT_MINGW '/foo' invalid_ref_normalized !MINGW '/foo'
invalid_ref_normalized 'heads/foo/../bar' invalid_ref_normalized 'heads/foo/../bar'
invalid_ref_normalized 'heads/./foo' invalid_ref_normalized 'heads/./foo'
invalid_ref_normalized 'heads\foo' invalid_ref_normalized 'heads\foo'

View File

@ -54,7 +54,7 @@ test_expect_success setup '
git add yours && git add yours &&
git commit -s -m "Second on side" && git commit -s -m "Second on side" &&
if test_have_prereq NOT_MINGW if test_have_prereq !MINGW
then then
# the second one on the side branch is ISO-8859-1 # the second one on the side branch is ISO-8859-1
git config i18n.commitencoding ISO8859-1 && git config i18n.commitencoding ISO8859-1 &&
@ -122,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
check_encoding 2 check_encoding 2
' '
test_expect_success NOT_MINGW 'rebase (L/L)' ' test_expect_success !MINGW 'rebase (L/L)' '
# In this test we want ISO-8859-1 encoded commits as the result # In this test we want ISO-8859-1 encoded commits as the result
git config i18n.commitencoding ISO8859-1 && git config i18n.commitencoding ISO8859-1 &&
git config i18n.logoutputencoding ISO8859-1 && git config i18n.logoutputencoding ISO8859-1 &&
@ -134,7 +134,7 @@ test_expect_success NOT_MINGW 'rebase (L/L)' '
check_encoding 2 8859 check_encoding 2 8859
' '
test_expect_success NOT_MINGW 'rebase (L/U)' ' test_expect_success !MINGW 'rebase (L/U)' '
# This is pathological -- use UTF-8 as intermediate form # This is pathological -- use UTF-8 as intermediate form
# to get ISO-8859-1 results. # to get ISO-8859-1 results.
git config i18n.commitencoding ISO8859-1 && git config i18n.commitencoding ISO8859-1 &&
@ -162,7 +162,7 @@ test_expect_success 'cherry-pick(U/U)' '
check_encoding 3 check_encoding 3
' '
test_expect_success NOT_MINGW 'cherry-pick(L/L)' ' test_expect_success !MINGW 'cherry-pick(L/L)' '
# Both the commitencoding and logoutputencoding is set to ISO-8859-1 # Both the commitencoding and logoutputencoding is set to ISO-8859-1
git config i18n.commitencoding ISO8859-1 && git config i18n.commitencoding ISO8859-1 &&
@ -192,7 +192,7 @@ test_expect_success 'cherry-pick(U/L)' '
check_encoding 3 check_encoding 3
' '
test_expect_success NOT_MINGW 'cherry-pick(L/U)' ' test_expect_success !MINGW 'cherry-pick(L/U)' '
# Again, the commitencoding is set to ISO-8859-1 but # Again, the commitencoding is set to ISO-8859-1 but
# logoutputencoding is set to UTF-8. # logoutputencoding is set to UTF-8.

View File

@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
test_cmp expect log.predictable test_cmp expect log.predictable
' '
test_expect_success NOT_MINGW 'shortlog wrapping' ' test_expect_success !MINGW 'shortlog wrapping' '
cat >expect <<\EOF && cat >expect <<\EOF &&
A U Thor (5): A U Thor (5):
Test Test
@ -114,7 +114,7 @@ EOF
test_cmp expect out test_cmp expect out
' '
test_expect_success NOT_MINGW 'shortlog from non-git directory' ' test_expect_success !MINGW 'shortlog from non-git directory' '
git log HEAD >log && git log HEAD >log &&
GIT_DIR=non-existing git shortlog -w <log >out && GIT_DIR=non-existing git shortlog -w <log >out &&
test_cmp expect out test_cmp expect out
@ -159,7 +159,7 @@ $DSCHO (2):
EOF EOF
test_expect_success NOT_MINGW 'shortlog encoding' ' test_expect_success !MINGW 'shortlog encoding' '
git reset --hard "$commit" && git reset --hard "$commit" &&
git config --unset i18n.commitencoding && git config --unset i18n.commitencoding &&
echo 2 > a1 && echo 2 > a1 &&

View File

@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
test_cmp expect actual test_cmp expect actual
' '
test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' ' test_expect_success !MINGW 'log --grep searches in log output encoding (latin1)' '
cat >expect <<-\EOF && cat >expect <<-\EOF &&
latin1 latin1
utf8 utf8
@ -43,7 +43,7 @@ test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin
test_cmp expect actual test_cmp expect actual
' '
test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' ' test_expect_success !MINGW 'log --grep does not find non-reencoded values (utf8)' '
>expect && >expect &&
git log --encoding=utf8 --format=%s --grep=$latin1_e >actual && git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
test_cmp expect actual test_cmp expect actual

View File

@ -318,7 +318,7 @@ test_expect_success 'clone myhost:src uses ssh' '
expect_ssh myhost src expect_ssh myhost src
' '
test_expect_success NOT_MINGW,NOT_CYGWIN 'clone local path foo:bar' ' test_expect_success !MINGW,!CYGWIN 'clone local path foo:bar' '
cp -R src "foo:bar" && cp -R src "foo:bar" &&
git clone "foo:bar" foobar && git clone "foo:bar" foobar &&
expect_ssh none expect_ssh none
@ -339,7 +339,7 @@ test_clone_url () {
expect_ssh "$2" "$3" expect_ssh "$2" "$3"
} }
test_expect_success NOT_MINGW 'clone c:temp is ssl' ' test_expect_success !MINGW 'clone c:temp is ssl' '
test_clone_url c:temp c temp test_clone_url c:temp c temp
' '

View File

@ -33,7 +33,7 @@ author $SJIS_NAME
summary $SJIS_MSG summary $SJIS_MSG
EOF EOF
test_expect_success NOT_MINGW \ test_expect_success !MINGW \
'blame respects i18n.commitencoding' ' 'blame respects i18n.commitencoding' '
git blame --incremental file | \ git blame --incremental file | \
egrep "^(author|summary) " > actual && egrep "^(author|summary) " > actual &&
@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME
summary $EUC_JAPAN_MSG summary $EUC_JAPAN_MSG
EOF EOF
test_expect_success NOT_MINGW \ test_expect_success !MINGW \
'blame respects i18n.logoutputencoding' ' 'blame respects i18n.logoutputencoding' '
git config i18n.logoutputencoding eucJP && git config i18n.logoutputencoding eucJP &&
git blame --incremental file | \ git blame --incremental file | \
@ -66,7 +66,7 @@ author $UTF8_NAME
summary $UTF8_MSG summary $UTF8_MSG
EOF EOF
test_expect_success NOT_MINGW \ test_expect_success !MINGW \
'blame respects --encoding=UTF-8' ' 'blame respects --encoding=UTF-8' '
git blame --incremental --encoding=UTF-8 file | \ git blame --incremental --encoding=UTF-8 file | \
egrep "^(author|summary) " > actual && egrep "^(author|summary) " > actual &&
@ -82,7 +82,7 @@ author $UTF8_NAME
summary $UTF8_MSG summary $UTF8_MSG
EOF EOF
test_expect_success NOT_MINGW \ test_expect_success !MINGW \
'blame respects --encoding=none' ' 'blame respects --encoding=none' '
git blame --incremental --encoding=none file | \ git blame --incremental --encoding=none file | \
egrep "^(author|summary) " > actual && egrep "^(author|summary) " > actual &&

View File

@ -2336,7 +2336,7 @@ test_expect_success 'R: cat-blob-fd must be a nonnegative integer' '
test_must_fail git fast-import --cat-blob-fd=-1 </dev/null test_must_fail git fast-import --cat-blob-fd=-1 </dev/null
' '
test_expect_success NOT_MINGW 'R: print old blob' ' test_expect_success !MINGW 'R: print old blob' '
blob=$(echo "yes it can" | git hash-object -w --stdin) && blob=$(echo "yes it can" | git hash-object -w --stdin) &&
cat >expect <<-EOF && cat >expect <<-EOF &&
${blob} blob 11 ${blob} blob 11
@ -2348,7 +2348,7 @@ test_expect_success NOT_MINGW 'R: print old blob' '
test_cmp expect actual test_cmp expect actual
' '
test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' ' test_expect_success !MINGW 'R: in-stream cat-blob-fd not respected' '
echo hello >greeting && echo hello >greeting &&
blob=$(git hash-object -w greeting) && blob=$(git hash-object -w greeting) &&
cat >expect <<-EOF && cat >expect <<-EOF &&
@ -2369,7 +2369,7 @@ test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '
test_cmp expect actual.1 test_cmp expect actual.1
' '
test_expect_success NOT_MINGW 'R: print new blob' ' test_expect_success !MINGW 'R: print new blob' '
blob=$(echo "yep yep yep" | git hash-object --stdin) && blob=$(echo "yep yep yep" | git hash-object --stdin) &&
cat >expect <<-EOF && cat >expect <<-EOF &&
${blob} blob 12 ${blob} blob 12
@ -2387,7 +2387,7 @@ test_expect_success NOT_MINGW 'R: print new blob' '
test_cmp expect actual test_cmp expect actual
' '
test_expect_success NOT_MINGW 'R: print new blob by sha1' ' test_expect_success !MINGW 'R: print new blob by sha1' '
blob=$(echo "a new blob named by sha1" | git hash-object --stdin) && blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
cat >expect <<-EOF && cat >expect <<-EOF &&
${blob} blob 25 ${blob} blob 25

View File

@ -365,7 +365,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
( (
cd "$git" && cd "$git" &&
echo git-wild-hash >dir1/git-wild#hash && echo git-wild-hash >dir1/git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
echo git-wild-star >dir1/git-wild\*star echo git-wild-star >dir1/git-wild\*star
fi && fi &&
@ -379,7 +379,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
( (
cd "$cli" && cd "$cli" &&
test_path_is_file dir1/git-wild#hash && test_path_is_file dir1/git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
test_path_is_file dir1/git-wild\*star test_path_is_file dir1/git-wild\*star
fi && fi &&

View File

@ -14,7 +14,7 @@ test_expect_success 'add p4 files with wildcards in the names' '
printf "file2\nhas\nsome\nrandom\ntext\n" >file2 && printf "file2\nhas\nsome\nrandom\ntext\n" >file2 &&
p4 add file2 && p4 add file2 &&
echo file-wild-hash >file-wild#hash && echo file-wild-hash >file-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
echo file-wild-star >file-wild\*star echo file-wild-star >file-wild\*star
fi && fi &&
@ -31,7 +31,7 @@ test_expect_success 'wildcard files git p4 clone' '
( (
cd "$git" && cd "$git" &&
test -f file-wild#hash && test -f file-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
test -f file-wild\*star test -f file-wild\*star
fi && fi &&
@ -46,7 +46,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
( (
cd "$git" && cd "$git" &&
echo git-wild-hash >git-wild#hash && echo git-wild-hash >git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
echo git-wild-star >git-wild\*star echo git-wild-star >git-wild\*star
fi && fi &&
@ -60,7 +60,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
( (
cd "$cli" && cd "$cli" &&
test_path_is_file git-wild#hash && test_path_is_file git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
test_path_is_file git-wild\*star test_path_is_file git-wild\*star
fi && fi &&
@ -75,7 +75,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
( (
cd "$git" && cd "$git" &&
echo new-line >>git-wild#hash && echo new-line >>git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
echo new-line >>git-wild\*star echo new-line >>git-wild\*star
fi && fi &&
@ -89,7 +89,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
( (
cd "$cli" && cd "$cli" &&
test_line_count = 2 git-wild#hash && test_line_count = 2 git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
test_line_count = 2 git-wild\*star test_line_count = 2 git-wild\*star
fi && fi &&
@ -152,7 +152,7 @@ test_expect_success 'wildcard files submit back to p4, delete' '
( (
cd "$cli" && cd "$cli" &&
test_path_is_missing git-wild#hash && test_path_is_missing git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN if test_have_prereq !MINGW !CYGWIN
then then
test_path_is_missing git-wild\*star test_path_is_missing git-wild\*star
fi && fi &&

View File

@ -417,7 +417,7 @@ test_expect_success 'cleanup chmod after submit cancel' '
! p4 fstat -T action text && ! p4 fstat -T action text &&
test_path_is_file text+x && test_path_is_file text+x &&
! p4 fstat -T action text+x && ! p4 fstat -T action text+x &&
if test_have_prereq NOT_CYGWIN if test_have_prereq !CYGWIN
then then
stat --format=%A text | egrep ^-r-- && stat --format=%A text | egrep ^-r-- &&
stat --format=%A text+x | egrep ^-r-x stat --format=%A text+x | egrep ^-r-x

View File

@ -866,7 +866,6 @@ case $(uname -s) in
# backslashes in pathspec are converted to '/' # backslashes in pathspec are converted to '/'
# exec does not inherit the PID # exec does not inherit the PID
test_set_prereq MINGW test_set_prereq MINGW
test_set_prereq NOT_CYGWIN
test_set_prereq SED_STRIPS_CR test_set_prereq SED_STRIPS_CR
test_set_prereq GREP_STRIPS_CR test_set_prereq GREP_STRIPS_CR
GIT_TEST_CMP=mingw_test_cmp GIT_TEST_CMP=mingw_test_cmp
@ -874,7 +873,6 @@ case $(uname -s) in
*CYGWIN*) *CYGWIN*)
test_set_prereq POSIXPERM test_set_prereq POSIXPERM
test_set_prereq EXECKEEPSPID test_set_prereq EXECKEEPSPID
test_set_prereq NOT_MINGW
test_set_prereq CYGWIN test_set_prereq CYGWIN
test_set_prereq SED_STRIPS_CR test_set_prereq SED_STRIPS_CR
test_set_prereq GREP_STRIPS_CR test_set_prereq GREP_STRIPS_CR
@ -883,8 +881,6 @@ case $(uname -s) in
test_set_prereq POSIXPERM test_set_prereq POSIXPERM
test_set_prereq BSLASHPSPEC test_set_prereq BSLASHPSPEC
test_set_prereq EXECKEEPSPID test_set_prereq EXECKEEPSPID
test_set_prereq NOT_MINGW
test_set_prereq NOT_CYGWIN
;; ;;
esac esac