Merge branch 'es/test-gpg-tags'
A test for tags has been restructured so that more parts of it can easily be run on a platform without a working GnuPG. * es/test-gpg-tags: t6302: skip only signed tags rather than all tests when GPG is missing t6302: also test annotated in addition to signed tags t6302: normalize names and descriptions of signed tags lib-gpg: drop unnecessary "missing GPG" warning
This commit is contained in:
commit
7ce0bee4c4
@ -1,9 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
gpg_version=$(gpg --version 2>&1)
|
gpg_version=$(gpg --version 2>&1)
|
||||||
if test $? = 127; then
|
if test $? != 127
|
||||||
say "You do not seem to have gpg installed"
|
then
|
||||||
else
|
|
||||||
# As said here: http://www.gnupg.org/documentation/faqs.html#q6.19
|
# As said here: http://www.gnupg.org/documentation/faqs.html#q6.19
|
||||||
# the gpg version 1.0.6 didn't parse trust packets correctly, so for
|
# the gpg version 1.0.6 didn't parse trust packets correctly, so for
|
||||||
# that version, creation of signed tags using the generated key fails.
|
# that version, creation of signed tags using the generated key fails.
|
||||||
|
@ -5,11 +5,14 @@ test_description='test for-each-refs usage of ref-filter APIs'
|
|||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-gpg.sh
|
. "$TEST_DIRECTORY"/lib-gpg.sh
|
||||||
|
|
||||||
if ! test_have_prereq GPG
|
test_prepare_expect () {
|
||||||
then
|
if test_have_prereq GPG
|
||||||
skip_all="skipping for-each-ref tests, GPG not available"
|
then
|
||||||
test_done
|
cat
|
||||||
fi
|
else
|
||||||
|
sed '/signed/d'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
test_expect_success 'setup some history and refs' '
|
test_expect_success 'setup some history and refs' '
|
||||||
test_commit one &&
|
test_commit one &&
|
||||||
@ -17,8 +20,13 @@ test_expect_success 'setup some history and refs' '
|
|||||||
test_commit three &&
|
test_commit three &&
|
||||||
git checkout -b side &&
|
git checkout -b side &&
|
||||||
test_commit four &&
|
test_commit four &&
|
||||||
git tag -s -m "A signed tag message" signed-tag &&
|
git tag -m "An annotated tag" annotated-tag &&
|
||||||
git tag -s -m "Annonated doubly" double-tag signed-tag &&
|
git tag -m "Annonated doubly" doubly-annotated-tag annotated-tag &&
|
||||||
|
if test_have_prereq GPG
|
||||||
|
then
|
||||||
|
git tag -s -m "A signed tag" signed-tag &&
|
||||||
|
git tag -s -m "Signed doubly" doubly-signed-tag signed-tag
|
||||||
|
fi &&
|
||||||
git checkout master &&
|
git checkout master &&
|
||||||
git update-ref refs/odd/spot master
|
git update-ref refs/odd/spot master
|
||||||
'
|
'
|
||||||
@ -34,8 +42,9 @@ test_expect_success 'filtering with --points-at' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'check signed tags with --points-at' '
|
test_expect_success 'check signed tags with --points-at' '
|
||||||
sed -e "s/Z$//" >expect <<-\EOF &&
|
test_prepare_expect <<-\EOF | sed -e "s/Z$//" >expect &&
|
||||||
refs/heads/side Z
|
refs/heads/side Z
|
||||||
|
refs/tags/annotated-tag four
|
||||||
refs/tags/four Z
|
refs/tags/four Z
|
||||||
refs/tags/signed-tag four
|
refs/tags/signed-tag four
|
||||||
EOF
|
EOF
|
||||||
@ -56,9 +65,11 @@ test_expect_success 'filtering with --merged' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'filtering with --no-merged' '
|
test_expect_success 'filtering with --no-merged' '
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
refs/heads/side
|
refs/heads/side
|
||||||
refs/tags/double-tag
|
refs/tags/annotated-tag
|
||||||
|
refs/tags/doubly-annotated-tag
|
||||||
|
refs/tags/doubly-signed-tag
|
||||||
refs/tags/four
|
refs/tags/four
|
||||||
refs/tags/signed-tag
|
refs/tags/signed-tag
|
||||||
EOF
|
EOF
|
||||||
@ -67,11 +78,13 @@ test_expect_success 'filtering with --no-merged' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'filtering with --contains' '
|
test_expect_success 'filtering with --contains' '
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
refs/heads/master
|
refs/heads/master
|
||||||
refs/heads/side
|
refs/heads/side
|
||||||
refs/odd/spot
|
refs/odd/spot
|
||||||
refs/tags/double-tag
|
refs/tags/annotated-tag
|
||||||
|
refs/tags/doubly-annotated-tag
|
||||||
|
refs/tags/doubly-signed-tag
|
||||||
refs/tags/four
|
refs/tags/four
|
||||||
refs/tags/signed-tag
|
refs/tags/signed-tag
|
||||||
refs/tags/three
|
refs/tags/three
|
||||||
@ -86,11 +99,13 @@ test_expect_success '%(color) must fail' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'left alignment is default' '
|
test_expect_success 'left alignment is default' '
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
refname is refs/heads/master |refs/heads/master
|
refname is refs/heads/master |refs/heads/master
|
||||||
refname is refs/heads/side |refs/heads/side
|
refname is refs/heads/side |refs/heads/side
|
||||||
refname is refs/odd/spot |refs/odd/spot
|
refname is refs/odd/spot |refs/odd/spot
|
||||||
refname is refs/tags/double-tag|refs/tags/double-tag
|
refname is refs/tags/annotated-tag|refs/tags/annotated-tag
|
||||||
|
refname is refs/tags/doubly-annotated-tag|refs/tags/doubly-annotated-tag
|
||||||
|
refname is refs/tags/doubly-signed-tag|refs/tags/doubly-signed-tag
|
||||||
refname is refs/tags/four |refs/tags/four
|
refname is refs/tags/four |refs/tags/four
|
||||||
refname is refs/tags/one |refs/tags/one
|
refname is refs/tags/one |refs/tags/one
|
||||||
refname is refs/tags/signed-tag|refs/tags/signed-tag
|
refname is refs/tags/signed-tag|refs/tags/signed-tag
|
||||||
@ -102,11 +117,13 @@ test_expect_success 'left alignment is default' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'middle alignment' '
|
test_expect_success 'middle alignment' '
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
| refname is refs/heads/master |refs/heads/master
|
| refname is refs/heads/master |refs/heads/master
|
||||||
| refname is refs/heads/side |refs/heads/side
|
| refname is refs/heads/side |refs/heads/side
|
||||||
| refname is refs/odd/spot |refs/odd/spot
|
| refname is refs/odd/spot |refs/odd/spot
|
||||||
|refname is refs/tags/double-tag|refs/tags/double-tag
|
|refname is refs/tags/annotated-tag|refs/tags/annotated-tag
|
||||||
|
|refname is refs/tags/doubly-annotated-tag|refs/tags/doubly-annotated-tag
|
||||||
|
|refname is refs/tags/doubly-signed-tag|refs/tags/doubly-signed-tag
|
||||||
| refname is refs/tags/four |refs/tags/four
|
| refname is refs/tags/four |refs/tags/four
|
||||||
| refname is refs/tags/one |refs/tags/one
|
| refname is refs/tags/one |refs/tags/one
|
||||||
|refname is refs/tags/signed-tag|refs/tags/signed-tag
|
|refname is refs/tags/signed-tag|refs/tags/signed-tag
|
||||||
@ -118,11 +135,13 @@ test_expect_success 'middle alignment' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'right alignment' '
|
test_expect_success 'right alignment' '
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
| refname is refs/heads/master|refs/heads/master
|
| refname is refs/heads/master|refs/heads/master
|
||||||
| refname is refs/heads/side|refs/heads/side
|
| refname is refs/heads/side|refs/heads/side
|
||||||
| refname is refs/odd/spot|refs/odd/spot
|
| refname is refs/odd/spot|refs/odd/spot
|
||||||
|refname is refs/tags/double-tag|refs/tags/double-tag
|
|refname is refs/tags/annotated-tag|refs/tags/annotated-tag
|
||||||
|
|refname is refs/tags/doubly-annotated-tag|refs/tags/doubly-annotated-tag
|
||||||
|
|refname is refs/tags/doubly-signed-tag|refs/tags/doubly-signed-tag
|
||||||
| refname is refs/tags/four|refs/tags/four
|
| refname is refs/tags/four|refs/tags/four
|
||||||
| refname is refs/tags/one|refs/tags/one
|
| refname is refs/tags/one|refs/tags/one
|
||||||
|refname is refs/tags/signed-tag|refs/tags/signed-tag
|
|refname is refs/tags/signed-tag|refs/tags/signed-tag
|
||||||
@ -133,11 +152,13 @@ test_expect_success 'right alignment' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<-\EOF
|
test_prepare_expect >expect <<-\EOF
|
||||||
| refname is refs/heads/master |refs/heads/master
|
| refname is refs/heads/master |refs/heads/master
|
||||||
| refname is refs/heads/side |refs/heads/side
|
| refname is refs/heads/side |refs/heads/side
|
||||||
| refname is refs/odd/spot |refs/odd/spot
|
| refname is refs/odd/spot |refs/odd/spot
|
||||||
| refname is refs/tags/double-tag |refs/tags/double-tag
|
| refname is refs/tags/annotated-tag |refs/tags/annotated-tag
|
||||||
|
|refname is refs/tags/doubly-annotated-tag |refs/tags/doubly-annotated-tag
|
||||||
|
| refname is refs/tags/doubly-signed-tag |refs/tags/doubly-signed-tag
|
||||||
| refname is refs/tags/four |refs/tags/four
|
| refname is refs/tags/four |refs/tags/four
|
||||||
| refname is refs/tags/one |refs/tags/one
|
| refname is refs/tags/one |refs/tags/one
|
||||||
| refname is refs/tags/signed-tag |refs/tags/signed-tag
|
| refname is refs/tags/signed-tag |refs/tags/signed-tag
|
||||||
@ -178,11 +199,13 @@ EOF
|
|||||||
# Individual atoms inside %(align:...) and %(end) must not be quoted.
|
# Individual atoms inside %(align:...) and %(end) must not be quoted.
|
||||||
|
|
||||||
test_expect_success 'alignment with format quote' "
|
test_expect_success 'alignment with format quote' "
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
|' '\''master| A U Thor'\'' '|
|
|' '\''master| A U Thor'\'' '|
|
||||||
|' '\''side| A U Thor'\'' '|
|
|' '\''side| A U Thor'\'' '|
|
||||||
|' '\''odd/spot| A U Thor'\'' '|
|
|' '\''odd/spot| A U Thor'\'' '|
|
||||||
|' '\''double-tag| '\'' '|
|
|' '\''annotated-tag| '\'' '|
|
||||||
|
|' '\''doubly-annotated-tag| '\'' '|
|
||||||
|
|' '\''doubly-signed-tag| '\'' '|
|
||||||
|' '\''four| A U Thor'\'' '|
|
|' '\''four| A U Thor'\'' '|
|
||||||
|' '\''one| A U Thor'\'' '|
|
|' '\''one| A U Thor'\'' '|
|
||||||
|' '\''signed-tag| '\'' '|
|
|' '\''signed-tag| '\'' '|
|
||||||
@ -194,11 +217,13 @@ test_expect_success 'alignment with format quote' "
|
|||||||
"
|
"
|
||||||
|
|
||||||
test_expect_success 'nested alignment with quote formatting' "
|
test_expect_success 'nested alignment with quote formatting' "
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
|' master '|
|
|' master '|
|
||||||
|' side '|
|
|' side '|
|
||||||
|' odd/spot '|
|
|' odd/spot '|
|
||||||
|' double-tag '|
|
|' annotated-tag '|
|
||||||
|
|'doubly-annotated-tag '|
|
||||||
|
|'doubly-signed-tag '|
|
||||||
|' four '|
|
|' four '|
|
||||||
|' one '|
|
|' one '|
|
||||||
|' signed-tag '|
|
|' signed-tag '|
|
||||||
@ -210,14 +235,16 @@ test_expect_success 'nested alignment with quote formatting' "
|
|||||||
"
|
"
|
||||||
|
|
||||||
test_expect_success 'check `%(contents:lines=1)`' '
|
test_expect_success 'check `%(contents:lines=1)`' '
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
master |three
|
master |three
|
||||||
side |four
|
side |four
|
||||||
odd/spot |three
|
odd/spot |three
|
||||||
double-tag |Annonated doubly
|
annotated-tag |An annotated tag
|
||||||
|
doubly-annotated-tag |Annonated doubly
|
||||||
|
doubly-signed-tag |Signed doubly
|
||||||
four |four
|
four |four
|
||||||
one |one
|
one |one
|
||||||
signed-tag |A signed tag message
|
signed-tag |A signed tag
|
||||||
three |three
|
three |three
|
||||||
two |two
|
two |two
|
||||||
EOF
|
EOF
|
||||||
@ -226,11 +253,13 @@ test_expect_success 'check `%(contents:lines=1)`' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'check `%(contents:lines=0)`' '
|
test_expect_success 'check `%(contents:lines=0)`' '
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
master |
|
master |
|
||||||
side |
|
side |
|
||||||
odd/spot |
|
odd/spot |
|
||||||
double-tag |
|
annotated-tag |
|
||||||
|
doubly-annotated-tag |
|
||||||
|
doubly-signed-tag |
|
||||||
four |
|
four |
|
||||||
one |
|
one |
|
||||||
signed-tag |
|
signed-tag |
|
||||||
@ -242,14 +271,16 @@ test_expect_success 'check `%(contents:lines=0)`' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'check `%(contents:lines=99999)`' '
|
test_expect_success 'check `%(contents:lines=99999)`' '
|
||||||
cat >expect <<-\EOF &&
|
test_prepare_expect >expect <<-\EOF &&
|
||||||
master |three
|
master |three
|
||||||
side |four
|
side |four
|
||||||
odd/spot |three
|
odd/spot |three
|
||||||
double-tag |Annonated doubly
|
annotated-tag |An annotated tag
|
||||||
|
doubly-annotated-tag |Annonated doubly
|
||||||
|
doubly-signed-tag |Signed doubly
|
||||||
four |four
|
four |four
|
||||||
one |one
|
one |one
|
||||||
signed-tag |A signed tag message
|
signed-tag |A signed tag
|
||||||
three |three
|
three |three
|
||||||
two |two
|
two |two
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user