test prerequisites: eradicate NOT_FOO
authorJunio C Hamano <gitster@pobox.com>
Mon, 21 Jul 2014 22:09:27 +0000 (15:09 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Jul 2014 22:42:34 +0000 (15:42 -0700)
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>
15 files changed:
t/t0008-ignores.sh
t/t0081-line-buffer.sh
t/t1020-subdirectory.sh
t/t1300-repo-config.sh
t/t1402-check-ref-format.sh
t/t3901-i18n-patch.sh
t/t4201-shortlog.sh
t/t4210-log-i18n.sh
t/t5601-clone.sh
t/t8005-blame-i18n.sh
t/t9300-fast-import.sh
t/t9809-git-p4-client-view.sh
t/t9812-git-p4-wildcards.sh
t/t9815-git-p4-submit-fail.sh
t/test-lib.sh
index 39e55a13c885399150094f9a2774f85e0acd63a6..8dc6939b9049baa32aca1200e36378e6e2296e9d 100755 (executable)
@@ -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  " &&
index 25dba008f3e4904cfe3100d9745a9b324622d779..ce92e6acad41712d6bc82b057858e7030c7ccde0 100755 (executable)
@@ -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 &&
index 62c0d25af4ca1c8ef5d0d63b6e3ea329a6d75205..2edb4f2de5cc32d0f8847790d06a8de0c98d99c3 100755 (executable)
@@ -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 &&
index 3f80ff0c14c47b87bbbecb74d1951a1abe6bc5ba..fb871d09cde59b87b47b92c798aacd1acf1375e2 100755 (executable)
@@ -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
@@ -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 \
index 9aeb352b3dba3fd7e46a5a0732425cd2686fc9f3..28e93186ab939103579a9af9e383b12d6e989aed 100755 (executable)
@@ -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
@@ -19,7 +19,7 @@ valid_ref() {
 invalid_ref() {
        prereq=
        case $1 in
-       [A-Z]*)
+       [A-Z!]*)
                prereq=$1
                shift
        esac
@@ -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'
@@ -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'
@@ -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
@@ -188,7 +188,7 @@ valid_ref_normalized() {
 invalid_ref_normalized() {
        prereq=
        case $1 in
-       [A-Z]*)
+       [A-Z!]*)
                prereq=$1
                shift
        esac
@@ -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'
index 55c8a2f57677085fe1185cd2e3e6d9a2021fd744..a392f3d1d66757361ff9fc4e26f4125da5ab0a4f 100755 (executable)
@@ -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 &&
@@ -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 &&
@@ -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 &&
@@ -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 &&
@@ -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.
 
index 565c020c45434bf151d7a142ebe1a1cca3299ab4..7600a3e3e8f4fab47abd68a29bb06defb6bbce02 100755 (executable)
@@ -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
@@ -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
@@ -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 &&
index 9110404e55eaacd10a73d7d4b2bae7f288a031b1..e585fe6129b7af264427d8af46de21cb08efad7f 100755 (executable)
@@ -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
@@ -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
index 5e67035be800b5cbec5a99dd9e3e458a343440df..e4f10c0f68b94bfa719c3d208f622541506c86b3 100755 (executable)
@@ -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
@@ -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
 '
 
index a6e73d063544a5856647d5cb9dc1260a0454f7ff..847d098c094566aafd8dd05fd3962e28f113360e 100755 (executable)
@@ -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 &&
@@ -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 | \
@@ -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 &&
@@ -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 &&
index 5fc9ef262ac1297d9442ed08208cb183ecc0e5c1..99f51614ad9ec3de8abf272d6fc6a778707a2292 100755 (executable)
@@ -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
@@ -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 &&
@@ -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
@@ -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
index 23a827fa77d0a5d527cef29a15a205ee14d68e27..e80db7aab3fd0384fb80f2735d927a26bf9114f5 100755 (executable)
@@ -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 &&
@@ -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 &&
index c7472cbf54584c7610094677693114d41b422afe..ed4b488a7eac8dd89253cdc97d83ce0eb6e0c8b4 100755 (executable)
@@ -14,7 +14,7 @@ test_expect_success 'add p4 files with wildcards in the names' '
                printf "file2\nhas\nsome\nrandom\ntext\n" >file2 &&
                p4 add file2 &&
                echo file-wild-hash >file-wild#hash &&
-               if test_have_prereq NOT_MINGW NOT_CYGWIN
+               if test_have_prereq !MINGW !CYGWIN
                then
                        echo file-wild-star >file-wild\*star
                fi &&
@@ -31,7 +31,7 @@ test_expect_success 'wildcard files git p4 clone' '
        (
                cd "$git" &&
                test -f file-wild#hash &&
-               if test_have_prereq NOT_MINGW NOT_CYGWIN
+               if test_have_prereq !MINGW !CYGWIN
                then
                        test -f file-wild\*star
                fi &&
@@ -46,7 +46,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
        (
                cd "$git" &&
                echo git-wild-hash >git-wild#hash &&
-               if test_have_prereq NOT_MINGW NOT_CYGWIN
+               if test_have_prereq !MINGW !CYGWIN
                then
                        echo git-wild-star >git-wild\*star
                fi &&
@@ -60,7 +60,7 @@ test_expect_success 'wildcard files submit back to p4, add' '
        (
                cd "$cli" &&
                test_path_is_file git-wild#hash &&
-               if test_have_prereq NOT_MINGW NOT_CYGWIN
+               if test_have_prereq !MINGW !CYGWIN
                then
                        test_path_is_file git-wild\*star
                fi &&
@@ -75,7 +75,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
        (
                cd "$git" &&
                echo new-line >>git-wild#hash &&
-               if test_have_prereq NOT_MINGW NOT_CYGWIN
+               if test_have_prereq !MINGW !CYGWIN
                then
                        echo new-line >>git-wild\*star
                fi &&
@@ -89,7 +89,7 @@ test_expect_success 'wildcard files submit back to p4, modify' '
        (
                cd "$cli" &&
                test_line_count = 2 git-wild#hash &&
-               if test_have_prereq NOT_MINGW NOT_CYGWIN
+               if test_have_prereq !MINGW !CYGWIN
                then
                        test_line_count = 2 git-wild\*star
                fi &&
@@ -152,7 +152,7 @@ test_expect_success 'wildcard files submit back to p4, delete' '
        (
                cd "$cli" &&
                test_path_is_missing git-wild#hash &&
-               if test_have_prereq NOT_MINGW NOT_CYGWIN
+               if test_have_prereq !MINGW !CYGWIN
                then
                        test_path_is_missing git-wild\*star
                fi &&
index 1243d96092ad5c6a66d66ee9debc399649ffa0a2..4cff6a760fc27b4f4f87c5f0387e34b3039e5518 100755 (executable)
@@ -417,7 +417,7 @@ test_expect_success 'cleanup chmod after submit cancel' '
                ! p4 fstat -T action text &&
                test_path_is_file text+x &&
                ! p4 fstat -T action text+x &&
-               if test_have_prereq NOT_CYGWIN
+               if test_have_prereq !CYGWIN
                then
                        stat --format=%A text | egrep ^-r-- &&
                        stat --format=%A text+x | egrep ^-r-x
index a4795373a6a2e1f247b3cef9880f2a82309b3594..b72f6bd414b48f8cbeaf8ac8cd3109e9e9f93ad3 100644 (file)
@@ -866,7 +866,6 @@ case $(uname -s) in
        # backslashes in pathspec are converted to '/'
        # exec does not inherit the PID
        test_set_prereq MINGW
-       test_set_prereq NOT_CYGWIN
        test_set_prereq SED_STRIPS_CR
        test_set_prereq GREP_STRIPS_CR
        GIT_TEST_CMP=mingw_test_cmp
@@ -874,7 +873,6 @@ case $(uname -s) in
 *CYGWIN*)
        test_set_prereq POSIXPERM
        test_set_prereq EXECKEEPSPID
-       test_set_prereq NOT_MINGW
        test_set_prereq CYGWIN
        test_set_prereq SED_STRIPS_CR
        test_set_prereq GREP_STRIPS_CR
@@ -883,8 +881,6 @@ case $(uname -s) in
        test_set_prereq POSIXPERM
        test_set_prereq BSLASHPSPEC
        test_set_prereq EXECKEEPSPID
-       test_set_prereq NOT_MINGW
-       test_set_prereq NOT_CYGWIN
        ;;
 esac