Skip to content

Commit

Permalink
test prerequisites: eradicate NOT_FOO
Browse files Browse the repository at this point in the history
Support for Back when bdccd3c (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>
  • Loading branch information
Junio C Hamano committed Jul 21, 2014
1 parent e8d0887 commit f57a871
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 60 deletions.
2 changes: 1 addition & 1 deletion t/t0008-ignores.sh
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ test_expect_success !MINGW 'quoting allows trailing whitespace' '
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 &&
mkdir whitespace &&
>"whitespace/trailing 1 " &&
Expand Down
2 changes: 1 addition & 1 deletion t/t0081-line-buffer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
test_cmp expect actual
'

test_expect_success NOT_MINGW 'read from file descriptor' '
test_expect_success !MINGW 'read from file descriptor' '
rm -f input &&
echo hello >expect &&
echo hello >input &&
Expand Down
2 changes: 1 addition & 1 deletion t/t1020-subdirectory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ test_expect_success 'alias expansion' '
)
'

test_expect_success NOT_MINGW '!alias expansion' '
test_expect_success !MINGW '!alias expansion' '
pwd >expect &&
(
git config alias.test-alias-directory !pwd &&
Expand Down
6 changes: 3 additions & 3 deletions t/t1300-repo-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -824,14 +824,14 @@ cat >expect <<\EOF
trailingtilde = foo~
EOF

test_expect_success NOT_MINGW 'set --path' '
test_expect_success !MINGW 'set --path' '
rm -f .git/config &&
git config --path path.home "~/" &&
git config --path path.normal "/dev/null" &&
git config --path path.trailingtilde "foo~" &&
test_cmp expect .git/config'

if test_have_prereq NOT_MINGW && test "${HOME+set}"
if test_have_prereq !MINGW && test "${HOME+set}"
then
test_set_prereq HOMEVAR
fi
Expand All @@ -854,7 +854,7 @@ cat >expect <<\EOF
foo~
EOF

test_expect_success NOT_MINGW 'get --path copes with unset $HOME' '
test_expect_success !MINGW 'get --path copes with unset $HOME' '
(
unset HOME;
test_must_fail git config --get --path path.home \
Expand Down
40 changes: 20 additions & 20 deletions t/t1402-check-ref-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test_description='Test git check-ref-format'
valid_ref() {
prereq=
case $1 in
[A-Z]*)
[A-Z!]*)
prereq=$1
shift
esac
Expand All @@ -19,7 +19,7 @@ valid_ref() {
invalid_ref() {
prereq=
case $1 in
[A-Z]*)
[A-Z!]*)
prereq=$1
shift
esac
Expand All @@ -30,17 +30,17 @@ invalid_ref() {
}

invalid_ref ''
invalid_ref NOT_MINGW '/'
invalid_ref NOT_MINGW '/' --allow-onelevel
invalid_ref NOT_MINGW '/' --normalize
invalid_ref NOT_MINGW '/' '--allow-onelevel --normalize'
invalid_ref !MINGW '/'
invalid_ref !MINGW '/' --allow-onelevel
invalid_ref !MINGW '/' --normalize
invalid_ref !MINGW '/' '--allow-onelevel --normalize'
valid_ref 'foo/bar/baz'
valid_ref 'foo/bar/baz' --normalize
invalid_ref 'refs///heads/foo'
valid_ref 'refs///heads/foo' --normalize
invalid_ref 'heads/foo/'
invalid_ref NOT_MINGW '/heads/foo'
valid_ref NOT_MINGW '/heads/foo' --normalize
invalid_ref !MINGW '/heads/foo'
valid_ref !MINGW '/heads/foo' --normalize
invalid_ref '///heads/foo'
valid_ref '///heads/foo' --normalize
invalid_ref './foo'
Expand Down Expand Up @@ -120,14 +120,14 @@ invalid_ref "$ref" --refspec-pattern
invalid_ref "$ref" '--refspec-pattern --allow-onelevel'

ref='/foo'
invalid_ref NOT_MINGW "$ref"
invalid_ref NOT_MINGW "$ref" --allow-onelevel
invalid_ref NOT_MINGW "$ref" --refspec-pattern
invalid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel'
invalid_ref NOT_MINGW "$ref" --normalize
valid_ref NOT_MINGW "$ref" '--allow-onelevel --normalize'
invalid_ref NOT_MINGW "$ref" '--refspec-pattern --normalize'
valid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
invalid_ref !MINGW "$ref"
invalid_ref !MINGW "$ref" --allow-onelevel
invalid_ref !MINGW "$ref" --refspec-pattern
invalid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel'
invalid_ref !MINGW "$ref" --normalize
valid_ref !MINGW "$ref" '--allow-onelevel --normalize'
invalid_ref !MINGW "$ref" '--refspec-pattern --normalize'
valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'


valid_ref 'refs/heads/a-very-long-refname'
Expand Down Expand Up @@ -176,7 +176,7 @@ test_expect_success 'check-ref-format --branch from subdir' '
valid_ref_normalized() {
prereq=
case $1 in
[A-Z]*)
[A-Z!]*)
prereq=$1
shift
esac
Expand All @@ -188,7 +188,7 @@ valid_ref_normalized() {
invalid_ref_normalized() {
prereq=
case $1 in
[A-Z]*)
[A-Z!]*)
prereq=$1
shift
esac
Expand All @@ -199,10 +199,10 @@ invalid_ref_normalized() {

valid_ref_normalized 'heads/foo' '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'
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'
invalid_ref_normalized 'heads\foo'
Expand Down
10 changes: 5 additions & 5 deletions t/t3901-i18n-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test_expect_success setup '
git add yours &&
git commit -s -m "Second on side" &&
if test_have_prereq NOT_MINGW
if test_have_prereq !MINGW
then
# the second one on the side branch is ISO-8859-1
git config i18n.commitencoding ISO8859-1 &&
Expand Down Expand Up @@ -122,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
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
git config i18n.commitencoding ISO8859-1 &&
git config i18n.logoutputencoding ISO8859-1 &&
Expand All @@ -134,7 +134,7 @@ test_expect_success NOT_MINGW 'rebase (L/L)' '
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
# to get ISO-8859-1 results.
git config i18n.commitencoding ISO8859-1 &&
Expand Down Expand Up @@ -162,7 +162,7 @@ test_expect_success 'cherry-pick(U/U)' '
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
git config i18n.commitencoding ISO8859-1 &&
Expand Down Expand Up @@ -192,7 +192,7 @@ test_expect_success 'cherry-pick(U/L)' '
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
# logoutputencoding is set to UTF-8.
Expand Down
6 changes: 3 additions & 3 deletions t/t4201-shortlog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
test_cmp expect log.predictable
'

test_expect_success NOT_MINGW 'shortlog wrapping' '
test_expect_success !MINGW 'shortlog wrapping' '
cat >expect <<\EOF &&
A U Thor (5):
Test
Expand All @@ -114,7 +114,7 @@ EOF
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_DIR=non-existing git shortlog -w <log >out &&
test_cmp expect out
Expand Down Expand Up @@ -159,7 +159,7 @@ $DSCHO (2):
EOF

test_expect_success NOT_MINGW 'shortlog encoding' '
test_expect_success !MINGW 'shortlog encoding' '
git reset --hard "$commit" &&
git config --unset i18n.commitencoding &&
echo 2 > a1 &&
Expand Down
4 changes: 2 additions & 2 deletions t/t4210-log-i18n.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
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 &&
latin1
utf8
Expand All @@ -43,7 +43,7 @@ test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin
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 &&
git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
test_cmp expect actual
Expand Down
4 changes: 2 additions & 2 deletions t/t5601-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ test_expect_success 'clone myhost:src uses ssh' '
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" &&
git clone "foo:bar" foobar &&
expect_ssh none
Expand All @@ -339,7 +339,7 @@ test_clone_url () {
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
'

Expand Down
8 changes: 4 additions & 4 deletions t/t8005-blame-i18n.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ author $SJIS_NAME
summary $SJIS_MSG
EOF

test_expect_success NOT_MINGW \
test_expect_success !MINGW \
'blame respects i18n.commitencoding' '
git blame --incremental file | \
egrep "^(author|summary) " > actual &&
Expand All @@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME
summary $EUC_JAPAN_MSG
EOF

test_expect_success NOT_MINGW \
test_expect_success !MINGW \
'blame respects i18n.logoutputencoding' '
git config i18n.logoutputencoding eucJP &&
git blame --incremental file | \
Expand All @@ -66,7 +66,7 @@ author $UTF8_NAME
summary $UTF8_MSG
EOF

test_expect_success NOT_MINGW \
test_expect_success !MINGW \
'blame respects --encoding=UTF-8' '
git blame --incremental --encoding=UTF-8 file | \
egrep "^(author|summary) " > actual &&
Expand All @@ -82,7 +82,7 @@ author $UTF8_NAME
summary $UTF8_MSG
EOF

test_expect_success NOT_MINGW \
test_expect_success !MINGW \
'blame respects --encoding=none' '
git blame --incremental --encoding=none file | \
egrep "^(author|summary) " > actual &&
Expand Down
8 changes: 4 additions & 4 deletions t/t9300-fast-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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_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) &&
cat >expect <<-EOF &&
${blob} blob 11
Expand All @@ -2348,7 +2348,7 @@ test_expect_success NOT_MINGW 'R: print old blob' '
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 &&
blob=$(git hash-object -w greeting) &&
cat >expect <<-EOF &&
Expand All @@ -2369,7 +2369,7 @@ test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '
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) &&
cat >expect <<-EOF &&
${blob} blob 12
Expand All @@ -2387,7 +2387,7 @@ test_expect_success NOT_MINGW 'R: print new blob' '
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) &&
cat >expect <<-EOF &&
${blob} blob 25
Expand Down
4 changes: 2 additions & 2 deletions t/t9809-git-p4-client-view.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
(
cd "$git" &&
echo git-wild-hash >dir1/git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN
if test_have_prereq !MINGW !CYGWIN
then
echo git-wild-star >dir1/git-wild\*star
fi &&
Expand All @@ -379,7 +379,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
(
cd "$cli" &&
test_path_is_file dir1/git-wild#hash &&
if test_have_prereq NOT_MINGW NOT_CYGWIN
if test_have_prereq !MINGW !CYGWIN
then
test_path_is_file dir1/git-wild\*star
fi &&
Expand Down
Loading

0 comments on commit f57a871

Please sign in to comment.