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>
Junio C Hamano committed
Jul 21, 2014 at 15:09 UTC
f57a8715bc5f50234dd1f756b3b26a0b81c3784c
15 files changed
+56
-60
t/t0008-ignores.sh
+1
-1
@@ -806,7 +806,7 @@ test_expect_success !MINGW 'quoting allows trailing whitespace' '
806
test_cmp err.expect err
807
'
808
809
-test_expect_success NOT_MINGW,NOT_CYGWIN 'correct handling of backslashes' '
809
+test_expect_success !MINGW,!CYGWIN 'correct handling of backslashes' '
810
rm -rf whitespace &&
811
mkdir whitespace &&
812
>"whitespace/trailing 1 " &&
t/t0081-line-buffer.sh
+1
-1
@@ -29,7 +29,7 @@ test_expect_success '0-length read, send along greeting' '
29
test_cmp expect actual
30
'
31
32
-test_expect_success NOT_MINGW 'read from file descriptor' '
32
+test_expect_success !MINGW 'read from file descriptor' '
33
rm -f input &&
34
echo hello >expect &&
35
echo hello >input &&
t/t1020-subdirectory.sh
+1
-1
@@ -118,7 +118,7 @@ test_expect_success 'alias expansion' '
118
)
119
'
120
121
-test_expect_success NOT_MINGW '!alias expansion' '
121
+test_expect_success !MINGW '!alias expansion' '
122
pwd >expect &&
123
(
124
git config alias.test-alias-directory !pwd &&
t/t1300-repo-config.sh
+3
-3
@@ -824,14 +824,14 @@ cat >expect <<\EOF
824
trailingtilde = foo~
825
EOF
826
827
-test_expect_success NOT_MINGW 'set --path' '
827
+test_expect_success !MINGW 'set --path' '
828
rm -f .git/config &&
829
git config --path path.home "~/" &&
830
git config --path path.normal "/dev/null" &&
831
git config --path path.trailingtilde "foo~" &&
832
test_cmp expect .git/config'
833
834
-if test_have_prereq NOT_MINGW && test "${HOME+set}"
834
+if test_have_prereq !MINGW && test "${HOME+set}"
835
then
836
test_set_prereq HOMEVAR
837
fi
@@ -854,7 +854,7 @@ cat >expect <<\EOF
854
foo~
855
EOF
856
857
-test_expect_success NOT_MINGW 'get --path copes with unset $HOME' '
857
+test_expect_success !MINGW 'get --path copes with unset $HOME' '
858
(
859
unset HOME;
860
test_must_fail git config --get --path path.home \
t/t1402-check-ref-format.sh
+20
-20
@@ -7,7 +7,7 @@ test_description='Test git check-ref-format'
7
valid_ref() {
8
prereq=
9
case $1 in
10
- [A-Z]*)
10
+ [A-Z!]*)
11
prereq=$1
12
shift
13
esac
@@ -19,7 +19,7 @@ valid_ref() {
19
invalid_ref() {
20
prereq=
21
case $1 in
22
- [A-Z]*)
22
+ [A-Z!]*)
23
prereq=$1
24
shift
25
esac
@@ -30,17 +30,17 @@ invalid_ref() {
30
}
31
32
invalid_ref ''
33
-invalid_ref NOT_MINGW '/'
34
-invalid_ref NOT_MINGW '/' --allow-onelevel
35
-invalid_ref NOT_MINGW '/' --normalize
36
-invalid_ref NOT_MINGW '/' '--allow-onelevel --normalize'
33
+invalid_ref !MINGW '/'
34
+invalid_ref !MINGW '/' --allow-onelevel
35
+invalid_ref !MINGW '/' --normalize
36
+invalid_ref !MINGW '/' '--allow-onelevel --normalize'
37
valid_ref 'foo/bar/baz'
38
valid_ref 'foo/bar/baz' --normalize
39
invalid_ref 'refs///heads/foo'
40
valid_ref 'refs///heads/foo' --normalize
41
invalid_ref 'heads/foo/'
42
-invalid_ref NOT_MINGW '/heads/foo'
43
-valid_ref NOT_MINGW '/heads/foo' --normalize
42
+invalid_ref !MINGW '/heads/foo'
43
+valid_ref !MINGW '/heads/foo' --normalize
44
invalid_ref '///heads/foo'
45
valid_ref '///heads/foo' --normalize
46
invalid_ref './foo'
@@ -120,14 +120,14 @@ invalid_ref "$ref" --refspec-pattern
120
invalid_ref "$ref" '--refspec-pattern --allow-onelevel'
121
122
ref='/foo'
123
-invalid_ref NOT_MINGW "$ref"
124
-invalid_ref NOT_MINGW "$ref" --allow-onelevel
125
-invalid_ref NOT_MINGW "$ref" --refspec-pattern
126
-invalid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel'
127
-invalid_ref NOT_MINGW "$ref" --normalize
128
-valid_ref NOT_MINGW "$ref" '--allow-onelevel --normalize'
129
-invalid_ref NOT_MINGW "$ref" '--refspec-pattern --normalize'
130
-valid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
123
+invalid_ref !MINGW "$ref"
124
+invalid_ref !MINGW "$ref" --allow-onelevel
125
+invalid_ref !MINGW "$ref" --refspec-pattern
126
+invalid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel'
127
+invalid_ref !MINGW "$ref" --normalize
128
+valid_ref !MINGW "$ref" '--allow-onelevel --normalize'
129
+invalid_ref !MINGW "$ref" '--refspec-pattern --normalize'
130
+valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
131
132
133
valid_ref 'refs/heads/a-very-long-refname'
@@ -176,7 +176,7 @@ test_expect_success 'check-ref-format --branch from subdir' '
176
valid_ref_normalized() {
177
prereq=
178
case $1 in
179
- [A-Z]*)
179
+ [A-Z!]*)
180
prereq=$1
181
shift
182
esac
@@ -188,7 +188,7 @@ valid_ref_normalized() {
188
invalid_ref_normalized() {
189
prereq=
190
case $1 in
191
- [A-Z]*)
191
+ [A-Z!]*)
192
prereq=$1
193
shift
194
esac
@@ -199,10 +199,10 @@ invalid_ref_normalized() {
199
200
valid_ref_normalized 'heads/foo' 'heads/foo'
201
valid_ref_normalized 'refs///heads/foo' 'refs/heads/foo'
202
-valid_ref_normalized NOT_MINGW '/heads/foo' 'heads/foo'
202
+valid_ref_normalized !MINGW '/heads/foo' 'heads/foo'
203
valid_ref_normalized '///heads/foo' 'heads/foo'
204
invalid_ref_normalized 'foo'
205
-invalid_ref_normalized NOT_MINGW '/foo'
205
+invalid_ref_normalized !MINGW '/foo'
206
invalid_ref_normalized 'heads/foo/../bar'
207
invalid_ref_normalized 'heads/./foo'
208
invalid_ref_normalized 'heads\foo'
t/t3901-i18n-patch.sh
+5
-5
@@ -54,7 +54,7 @@ test_expect_success setup '
54
git add yours &&
55
git commit -s -m "Second on side" &&
56
57
- if test_have_prereq NOT_MINGW
57
+ if test_have_prereq !MINGW
58
then
59
# the second one on the side branch is ISO-8859-1
60
git config i18n.commitencoding ISO8859-1 &&
@@ -122,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
122
check_encoding 2
123
'
124
125
-test_expect_success NOT_MINGW 'rebase (L/L)' '
125
+test_expect_success !MINGW 'rebase (L/L)' '
126
# In this test we want ISO-8859-1 encoded commits as the result
127
git config i18n.commitencoding ISO8859-1 &&
128
git config i18n.logoutputencoding ISO8859-1 &&
@@ -134,7 +134,7 @@ test_expect_success NOT_MINGW 'rebase (L/L)' '
134
check_encoding 2 8859
135
'
136
137
-test_expect_success NOT_MINGW 'rebase (L/U)' '
137
+test_expect_success !MINGW 'rebase (L/U)' '
138
# This is pathological -- use UTF-8 as intermediate form
139
# to get ISO-8859-1 results.
140
git config i18n.commitencoding ISO8859-1 &&
@@ -162,7 +162,7 @@ test_expect_success 'cherry-pick(U/U)' '
162
check_encoding 3
163
'
164
165
-test_expect_success NOT_MINGW 'cherry-pick(L/L)' '
165
+test_expect_success !MINGW 'cherry-pick(L/L)' '
166
# Both the commitencoding and logoutputencoding is set to ISO-8859-1
167
168
git config i18n.commitencoding ISO8859-1 &&
@@ -192,7 +192,7 @@ test_expect_success 'cherry-pick(U/L)' '
192
check_encoding 3
193
'
194
195
-test_expect_success NOT_MINGW 'cherry-pick(L/U)' '
195
+test_expect_success !MINGW 'cherry-pick(L/U)' '
196
# Again, the commitencoding is set to ISO-8859-1 but
197
# logoutputencoding is set to UTF-8.
198
t/t4201-shortlog.sh
+3
-3
@@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
93
test_cmp expect log.predictable
94
'
95
96
-test_expect_success NOT_MINGW 'shortlog wrapping' '
96
+test_expect_success !MINGW 'shortlog wrapping' '
97
cat >expect <<\EOF &&
98
A U Thor (5):
99
Test
@@ -114,7 +114,7 @@ EOF
114
test_cmp expect out
115
'
116
117
-test_expect_success NOT_MINGW 'shortlog from non-git directory' '
117
+test_expect_success !MINGW 'shortlog from non-git directory' '
118
git log HEAD >log &&
119
GIT_DIR=non-existing git shortlog -w <log >out &&
120
test_cmp expect out
@@ -159,7 +159,7 @@ $DSCHO (2):
159
160
EOF
161
162
-test_expect_success NOT_MINGW 'shortlog encoding' '
162
+test_expect_success !MINGW 'shortlog encoding' '
163
git reset --hard "$commit" &&
164
git config --unset i18n.commitencoding &&
165
echo 2 > a1 &&
t/t4210-log-i18n.sh
+2
-2
@@ -34,7 +34,7 @@ test_expect_success 'log --grep searches in log output encoding (utf8)' '
34
test_cmp expect actual
35
'
36
37
-test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin1)' '
37
+test_expect_success !MINGW 'log --grep searches in log output encoding (latin1)' '
38
cat >expect <<-\EOF &&
39
latin1
40
utf8
@@ -43,7 +43,7 @@ test_expect_success NOT_MINGW 'log --grep searches in log output encoding (latin
43
test_cmp expect actual
44
'
45
46
-test_expect_success NOT_MINGW 'log --grep does not find non-reencoded values (utf8)' '
46
+test_expect_success !MINGW 'log --grep does not find non-reencoded values (utf8)' '
47
>expect &&
48
git log --encoding=utf8 --format=%s --grep=$latin1_e >actual &&
49
test_cmp expect actual
t/t5601-clone.sh
+2
-2
@@ -318,7 +318,7 @@ test_expect_success 'clone myhost:src uses ssh' '
318
expect_ssh myhost src
319
'
320
321
-test_expect_success NOT_MINGW,NOT_CYGWIN 'clone local path foo:bar' '
321
+test_expect_success !MINGW,!CYGWIN 'clone local path foo:bar' '
322
cp -R src "foo:bar" &&
323
git clone "foo:bar" foobar &&
324
expect_ssh none
@@ -339,7 +339,7 @@ test_clone_url () {
339
expect_ssh "$2" "$3"
340
}
341
342
-test_expect_success NOT_MINGW 'clone c:temp is ssl' '
342
+test_expect_success !MINGW 'clone c:temp is ssl' '
343
test_clone_url c:temp c temp
344
'
345
t/t8005-blame-i18n.sh
+4
-4
@@ -33,7 +33,7 @@ author $SJIS_NAME
33
summary $SJIS_MSG
34
EOF
35
36
-test_expect_success NOT_MINGW \
36
+test_expect_success !MINGW \
37
'blame respects i18n.commitencoding' '
38
git blame --incremental file | \
39
egrep "^(author|summary) " > actual &&
@@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME
49
summary $EUC_JAPAN_MSG
50
EOF
51
52
-test_expect_success NOT_MINGW \
52
+test_expect_success !MINGW \
53
'blame respects i18n.logoutputencoding' '
54
git config i18n.logoutputencoding eucJP &&
55
git blame --incremental file | \
@@ -66,7 +66,7 @@ author $UTF8_NAME
66
summary $UTF8_MSG
67
EOF
68
69
-test_expect_success NOT_MINGW \
69
+test_expect_success !MINGW \
70
'blame respects --encoding=UTF-8' '
71
git blame --incremental --encoding=UTF-8 file | \
72
egrep "^(author|summary) " > actual &&
@@ -82,7 +82,7 @@ author $UTF8_NAME
82
summary $UTF8_MSG
83
EOF
84
85
-test_expect_success NOT_MINGW \
85
+test_expect_success !MINGW \
86
'blame respects --encoding=none' '
87
git blame --incremental --encoding=none file | \
88
egrep "^(author|summary) " > actual &&
t/t9300-fast-import.sh
+4
-4
@@ -2336,7 +2336,7 @@ test_expect_success 'R: cat-blob-fd must be a nonnegative integer' '
2336
test_must_fail git fast-import --cat-blob-fd=-1 </dev/null
2337
'
2338
2339
-test_expect_success NOT_MINGW 'R: print old blob' '
2339
+test_expect_success !MINGW 'R: print old blob' '
2340
blob=$(echo "yes it can" | git hash-object -w --stdin) &&
2341
cat >expect <<-EOF &&
2342
${blob} blob 11
@@ -2348,7 +2348,7 @@ test_expect_success NOT_MINGW 'R: print old blob' '
2348
test_cmp expect actual
2349
'
2350
2351
-test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '
2351
+test_expect_success !MINGW 'R: in-stream cat-blob-fd not respected' '
2352
echo hello >greeting &&
2353
blob=$(git hash-object -w greeting) &&
2354
cat >expect <<-EOF &&
@@ -2369,7 +2369,7 @@ test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '
2369
test_cmp expect actual.1
2370
'
2371
2372
-test_expect_success NOT_MINGW 'R: print new blob' '
2372
+test_expect_success !MINGW 'R: print new blob' '
2373
blob=$(echo "yep yep yep" | git hash-object --stdin) &&
2374
cat >expect <<-EOF &&
2375
${blob} blob 12
@@ -2387,7 +2387,7 @@ test_expect_success NOT_MINGW 'R: print new blob' '
2387
test_cmp expect actual
2388
'
2389
2390
-test_expect_success NOT_MINGW 'R: print new blob by sha1' '
2390
+test_expect_success !MINGW 'R: print new blob by sha1' '
2391
blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
2392
cat >expect <<-EOF &&
2393
${blob} blob 25
t/t9809-git-p4-client-view.sh
+2
-2
@@ -365,7 +365,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
365
(
366
cd "$git" &&
367
echo git-wild-hash >dir1/git-wild#hash &&
368
- if test_have_prereq NOT_MINGW NOT_CYGWIN
368
+ if test_have_prereq !MINGW !CYGWIN
369
then
370
echo git-wild-star >dir1/git-wild\*star
371
fi &&
@@ -379,7 +379,7 @@ test_expect_success 'wildcard files submit back to p4, client-spec case' '
379
(
380
cd "$cli" &&
381
test_path_is_file dir1/git-wild#hash &&
382
- if test_have_prereq NOT_MINGW NOT_CYGWIN
382
+ if test_have_prereq !MINGW !CYGWIN
383
then
384
test_path_is_file dir1/git-wild\*star
385
fi &&
t/t9812-git-p4-wildcards.sh
+7
-7
@@ -14,7 +14,7 @@ test_expect_success 'add p4 files with wildcards in the names' '
14
printf "file2\nhas\nsome\nrandom\ntext\n" >file2 &&
15
p4 add file2 &&
16
echo file-wild-hash >file-wild#hash &&
17
- if test_have_prereq NOT_MINGW NOT_CYGWIN
17
+ if test_have_prereq !MINGW !CYGWIN
18
then
19
echo file-wild-star >file-wild\*star
20
fi &&
@@ -31,7 +31,7 @@ test_expect_success 'wildcard files git p4 clone' '
31
(
32
cd "$git" &&
33
test -f file-wild#hash &&
34
- if test_have_prereq NOT_MINGW NOT_CYGWIN
34
+ if test_have_prereq !MINGW !CYGWIN
35
then
36
test -f file-wild\*star
37
fi &&
@@ -46,7 +46,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
46
(
47
cd "$git" &&
48
echo git-wild-hash >git-wild#hash &&
49
- if test_have_prereq NOT_MINGW NOT_CYGWIN
49
+ if test_have_prereq !MINGW !CYGWIN
50
then
51
echo git-wild-star >git-wild\*star
52
fi &&
@@ -60,7 +60,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
60
(
61
cd "$cli" &&
62
test_path_is_file git-wild#hash &&
63
- if test_have_prereq NOT_MINGW NOT_CYGWIN
63
+ if test_have_prereq !MINGW !CYGWIN
64
then
65
test_path_is_file git-wild\*star
66
fi &&
@@ -75,7 +75,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
75
(
76
cd "$git" &&
77
echo new-line >>git-wild#hash &&
78
- if test_have_prereq NOT_MINGW NOT_CYGWIN
78
+ if test_have_prereq !MINGW !CYGWIN
79
then
80
echo new-line >>git-wild\*star
81
fi &&
@@ -89,7 +89,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
89
(
90
cd "$cli" &&
91
test_line_count = 2 git-wild#hash &&
92
- if test_have_prereq NOT_MINGW NOT_CYGWIN
92
+ if test_have_prereq !MINGW !CYGWIN
93
then
94
test_line_count = 2 git-wild\*star
95
fi &&
@@ -152,7 +152,7 @@ test_expect_success 'wildcard files submit back to p4, delete' '
152
(
153
cd "$cli" &&
154
test_path_is_missing git-wild#hash &&
155
- if test_have_prereq NOT_MINGW NOT_CYGWIN
155
+ if test_have_prereq !MINGW !CYGWIN
156
then
157
test_path_is_missing git-wild\*star
158
fi &&
t/t9815-git-p4-submit-fail.sh
+1
-1
@@ -417,7 +417,7 @@ test_expect_success 'cleanup chmod after submit cancel' '
417
! p4 fstat -T action text &&
418
test_path_is_file text+x &&
419
! p4 fstat -T action text+x &&
420
- if test_have_prereq NOT_CYGWIN
420
+ if test_have_prereq !CYGWIN
421
then
422
stat --format=%A text | egrep ^-r-- &&
423
stat --format=%A text+x | egrep ^-r-x
t/test-lib.sh
-4
@@ -866,7 +866,6 @@ case $(uname -s) in
866
# backslashes in pathspec are converted to '/'
867
# exec does not inherit the PID
868
test_set_prereq MINGW
869
- test_set_prereq NOT_CYGWIN
869
test_set_prereq SED_STRIPS_CR
870
test_set_prereq GREP_STRIPS_CR
871
GIT_TEST_CMP=mingw_test_cmp
@@ -874,7 +873,6 @@ case $(uname -s) in
873
*CYGWIN*)
874
test_set_prereq POSIXPERM
875
test_set_prereq EXECKEEPSPID
877
- test_set_prereq NOT_MINGW
876
test_set_prereq CYGWIN
877
test_set_prereq SED_STRIPS_CR
878
test_set_prereq GREP_STRIPS_CR
@@ -883,8 +881,6 @@ case $(uname -s) in
881
test_set_prereq POSIXPERM
882
test_set_prereq BSLASHPSPEC
883
test_set_prereq EXECKEEPSPID
886
- test_set_prereq NOT_MINGW
887
- test_set_prereq NOT_CYGWIN
884
;;
885
esac
886