X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftests%2Ftagupl;h=9d3e45a1c177700e7674156d7256d46e1cd45406;hb=4bbb0ea95dcf9be8e26f19424ad3b5269a556783;hp=c7396c4306540f2894d9c38c0092a55fbd1d9aa4;hpb=e421140af47f0d64e018100b91b79c48fe83f729;p=dgit.git diff --git a/tests/tests/tagupl b/tests/tests/tagupl index c7396c43..9d3e45a1 100755 --- a/tests/tests/tagupl +++ b/tests/tests/tagupl @@ -18,15 +18,34 @@ git checkout -b native git checkout --orphan upstream quilt-tip-2 git rm -rf debian git commit -m 'pseudo-upstream' -git tag upstream/1.0 +upstreamtag=UPSTREAM/RELEASE/1.0 +git tag $upstreamtag git checkout -B master quilt-tip-2 +echo foo >bar +git add bar +git commit -m"corrupt the upstream source to test upstream-nonidentical check" + t-tagupl-settings tagname=test-dummy/$v -t-tagupl-test --quilt=gbp +t-expect-fail "the upstream source in tag $upstreamtag is not identical to the upstream source in refs/heads/master" \ +t-tagupl-test --quilt=gbp --upstream=$upstreamtag + +git reset --hard HEAD~1 + +t-expect-fail "upstream tag $upstreamtag is not an ancestor of refs/heads/master" \ +t-tagupl-test --quilt=gbp --upstream=$upstreamtag + +t-expect-fail "upstream tag $upstreamtag is not an ancestor of refs/heads/master" \ +t-tagupl-test --quilt=gbp --force=suite --force=no-such-force-option --upstream=$upstreamtag + +t-tagupl-test --quilt=gbp --force=suite --force=no-such-force-option-1 \ + --force=upstream-nonancestor,no-such-force-option-2 \ + --upstream=$upstreamtag +t-pushed-good master # todo: test each miss/rejection @@ -61,25 +80,26 @@ with-mangled () { perl <../basetag >../badtag-$ident -pe "$perl" git tag -u Senatus -f -s -m "$(cat ../badtag-$ident)" "$tagname" + LC_MESSAGES=C \ t-tagupl-run-drs $tmp/$p } expect-quit () { next-mangle "$1" local perl=$2 - local mstring=$3 + local mregexp=$3 with-mangled "$perl" - grep ": $mstring" ../tagupl/overall.log + egrep ": $mregexp" ../tagupl/overall.log } expect-email () { next-mangle "$1" local perl=$2 - local mstring=$3 + local mregexp=$3 with-mangled "$perl" - grep 'Was not successful' ../sendmail.log - grep "$mstring" ../sendmail.log - grep ": failed, emailed" ../tagupl/overall.log + egrep 'Was not successful' ../sendmail.log + egrep "$mregexp" ../sendmail.log + egrep ": failed, emailed" ../tagupl/overall.log } raw-mangled () { @@ -118,7 +138,7 @@ expect-email bupstag1 's/ upstream-tag=/$&:/' \ "failed command: git check-ref-format" expect-email bupstag2 's/ upstream-tag=/$&x/' \ - "Couldn't find remote ref refs/tags/xupstream" + "[Cc]ouldn't find remote ref refs/tags/xUPSTREAM" expect-email wrongver '' 'mismatch: changelog Version'